julia_coursera/01_Coursera_1.ipynb

165 lines
4.5 KiB
Plaintext
Raw Normal View History

2020-05-17 04:38:06 +00:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hello World!\n"
]
}
],
"source": [
"println(\"Hello World!\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"14"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"5+9 # 14"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hello! My word! Hello! My word! \n"
]
}
],
"source": [
"println((\"Hello!\" * \" My word! \")^2)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"search: \u001b[0m\u001b[1mp\u001b[22m\u001b[0m\u001b[1mr\u001b[22m\u001b[0m\u001b[1mi\u001b[22m\u001b[0m\u001b[1mn\u001b[22m\u001b[0m\u001b[1mt\u001b[22m\u001b[0m\u001b[1ml\u001b[22m\u001b[0m\u001b[1mn\u001b[22m \u001b[0m\u001b[1mp\u001b[22m\u001b[0m\u001b[1mr\u001b[22m\u001b[0m\u001b[1mi\u001b[22m\u001b[0m\u001b[1mn\u001b[22m\u001b[0m\u001b[1mt\u001b[22msty\u001b[0m\u001b[1ml\u001b[22med \u001b[0m\u001b[1mp\u001b[22m\u001b[0m\u001b[1mr\u001b[22m\u001b[0m\u001b[1mi\u001b[22m\u001b[0m\u001b[1mn\u001b[22m\u001b[0m\u001b[1mt\u001b[22m s\u001b[0m\u001b[1mp\u001b[22m\u001b[0m\u001b[1mr\u001b[22m\u001b[0m\u001b[1mi\u001b[22m\u001b[0m\u001b[1mn\u001b[22m\u001b[0m\u001b[1mt\u001b[22m is\u001b[0m\u001b[1mp\u001b[22m\u001b[0m\u001b[1mr\u001b[22m\u001b[0m\u001b[1mi\u001b[22m\u001b[0m\u001b[1mn\u001b[22m\u001b[0m\u001b[1mt\u001b[22m\n",
"\n"
]
},
{
"data": {
"text/latex": [
"\\begin{verbatim}\n",
"println([io::IO], xs...)\n",
"\\end{verbatim}\n",
"Print (using \\href{@ref}{\\texttt{print}}) \\texttt{xs} followed by a newline. If \\texttt{io} is not supplied, prints to \\href{@ref}{\\texttt{stdout}}.\n",
"\n",
"\\section{Examples}\n",
"\\begin{verbatim}\n",
"julia> println(\"Hello, world\")\n",
"Hello, world\n",
"\n",
"julia> io = IOBuffer();\n",
"\n",
"julia> println(io, \"Hello, world\")\n",
"\n",
"julia> String(take!(io))\n",
"\"Hello, world\\n\"\n",
"\\end{verbatim}\n"
],
"text/markdown": [
"```\n",
"println([io::IO], xs...)\n",
"```\n",
"\n",
"Print (using [`print`](@ref)) `xs` followed by a newline. If `io` is not supplied, prints to [`stdout`](@ref).\n",
"\n",
"# Examples\n",
"\n",
"```jldoctest\n",
"julia> println(\"Hello, world\")\n",
"Hello, world\n",
"\n",
"julia> io = IOBuffer();\n",
"\n",
"julia> println(io, \"Hello, world\")\n",
"\n",
"julia> String(take!(io))\n",
"\"Hello, world\\n\"\n",
"```\n"
],
"text/plain": [
"\u001b[36m println([io::IO], xs...)\u001b[39m\n",
"\n",
" Print (using \u001b[36mprint\u001b[39m) \u001b[36mxs\u001b[39m followed by a newline. If \u001b[36mio\u001b[39m is not supplied, prints\n",
" to \u001b[36mstdout\u001b[39m.\n",
"\n",
"\u001b[1m Examples\u001b[22m\n",
"\u001b[1m ≡≡≡≡≡≡≡≡≡≡\u001b[22m\n",
"\n",
"\u001b[36m julia> println(\"Hello, world\")\u001b[39m\n",
"\u001b[36m Hello, world\u001b[39m\n",
"\u001b[36m \u001b[39m\n",
"\u001b[36m julia> io = IOBuffer();\u001b[39m\n",
"\u001b[36m \u001b[39m\n",
"\u001b[36m julia> println(io, \"Hello, world\")\u001b[39m\n",
"\u001b[36m \u001b[39m\n",
"\u001b[36m julia> String(take!(io))\u001b[39m\n",
"\u001b[36m \"Hello, world\\n\"\u001b[39m"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"?println"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.2.0",
"language": "julia",
"name": "julia-1.2"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.2.0"
}
},
"nbformat": 4,
"nbformat_minor": 4
}