{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "7604677e-d534-4517-b4ca-16e4263f297d", "metadata": {}, "outputs": [], "source": [ "#=\n", "\n", "multiline comment \n", "\n", "=#" ] }, { "cell_type": "code", "execution_count": 2, "id": "cb0294f4-230a-403a-b5ba-8c6fdcdf26cd", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# basic math\n", "1 + 1" ] }, { "cell_type": "code", "execution_count": 3, "id": "7c4a5333-4506-4d2c-8aca-57a98c58e908", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "6" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "2*3" ] }, { "cell_type": "code", "execution_count": 4, "id": "4e472842-c29b-435c-903a-9f4a47cc6a5f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2.0" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "4/2" ] }, { "cell_type": "code", "execution_count": 5, "id": "6cc6e87c-1fb7-4573-9736-ff0214b4301c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "8" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# exponentiation \n", "2^3" ] }, { "cell_type": "code", "execution_count": 6, "id": "66d78556-43b2-4dc6-be89-7620f1fa59ec", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# modulo\n", "5 % 2" ] }, { "cell_type": "code", "execution_count": 7, "id": "677d5d98-e3b2-46ad-85ff-28827849686c", "metadata": {}, "outputs": [], "source": [ "# Booleans" ] }, { "cell_type": "code", "execution_count": 8, "id": "08d0df2a-a7bb-45c1-a3e6-3ae5b6171760", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "true" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "true" ] }, { "cell_type": "code", "execution_count": 9, "id": "39351477-4b50-4e08-b13f-5ced39d6875b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "false" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "false" ] }, { "cell_type": "code", "execution_count": 10, "id": "b8fcfdac-967a-47aa-a1b2-4c72ae28cff9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "false" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "3 < 2" ] }, { "cell_type": "code", "execution_count": 11, "id": "6991b893-bd6e-4d9f-9b3e-4a8b539814eb", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "true" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "3 >= 3" ] }, { "cell_type": "code", "execution_count": 12, "id": "e2034ad0-3ace-4473-88f9-afca82a2f7f7", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "false" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "4 == 3" ] }, { "cell_type": "code", "execution_count": 13, "id": "e47842de-68b1-454a-ae5f-82de3cb2c1b5", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "true" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "4 != 3" ] }, { "cell_type": "code", "execution_count": 14, "id": "9dd81547-85b3-436f-a45d-5f6e9c0dcb48", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "true" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "true & true" ] }, { "cell_type": "code", "execution_count": 15, "id": "43a3c172-9b14-4b8f-9c7b-1b9e174315d9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "true" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "true | false" ] }, { "cell_type": "code", "execution_count": 16, "id": "5a757ce0-4a67-47d7-87d4-11a22ec73f0d", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "true" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# short circuit boolean operators && ||\n", "true && true" ] }, { "cell_type": "code", "execution_count": 17, "id": "e2af2475-6856-465f-b7c4-a709dab63879", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "false" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "1 == 1 && 1 > 1" ] }, { "cell_type": "code", "execution_count": 18, "id": "1506ef89-5259-4b8b-8fb1-aa98320f5844", "metadata": {}, "outputs": [], "source": [ "# variables" ] }, { "cell_type": "code", "execution_count": 19, "id": "89ffb3c3-98e8-44ea-bca2-d9ff89f6cd04", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "x =1\n", "y = 2\n", "z = x+ y" ] }, { "cell_type": "code", "execution_count": 20, "id": "bc28dda6-39a1-4cb7-a468-6c3a23b6c707", "metadata": {}, "outputs": [], "source": [ "# how to increment" ] }, { "cell_type": "code", "execution_count": 21, "id": "17c4d242-a155-4050-955c-88870c6c50f4", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "i =1\n", "i = i + 1" ] }, { "cell_type": "code", "execution_count": 22, "id": "757ad93e-58e2-4f73-bfb6-e02a955d2d0a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "i += 1" ] }, { "cell_type": "code", "execution_count": 23, "id": "601adc95-27f9-4154-949b-70aaf1fbf758", "metadata": {}, "outputs": [], "source": [ "# numbers" ] }, { "cell_type": "code", "execution_count": 24, "id": "54fa5605-232c-4dca-b5e0-796dd0d5a06e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Int64" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "typeof(-3)" ] }, { "cell_type": "code", "execution_count": 25, "id": "bee4ae6e-347b-48fe-9406-b581738b2f77", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Int64" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "typeof(4)" ] }, { "cell_type": "code", "execution_count": 26, "id": "e8a1b430-1591-45a7-8536-a811a31ddb99", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "12" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "example::Int32 = 12" ] }, { "cell_type": "code", "execution_count": 27, "id": "6ab848ba-edbd-4826-97ab-b1a58d6bbde7", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Int32" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "typeof(example)" ] }, { "cell_type": "code", "execution_count": 28, "id": "870380a7-f015-4d7f-8c94-0c1b0b5f19c2", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0.30000000000000004" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "0.1 + 0.2" ] }, { "cell_type": "code", "execution_count": 29, "id": "6af3ce02-8519-4948-9a4f-c792f2e7bed5", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "true" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "isapprox(0.1+0.2, 0.3)" ] }, { "cell_type": "code", "execution_count": 30, "id": "1bb895c2-764d-4179-a850-c700de16b72a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1//3" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "1//3" ] }, { "cell_type": "code", "execution_count": 31, "id": "ec491fc0-1b19-4779-aa10-0d4db8db9eb6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Rational{Int64}" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "typeof(1//3)" ] }, { "cell_type": "code", "execution_count": 32, "id": "7eb3e322-503c-4ad7-8402-c421400cf513", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3.14159" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "round(pi, digits = 5)" ] }, { "cell_type": "code", "execution_count": 33, "id": "6a9cf2cf-9ed6-4ab9-b536-f0daeeeea2aa", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1.4142135623730951" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sqrt(2)" ] }, { "cell_type": "code", "execution_count": 34, "id": "252139b2-3863-4492-b593-6cdf99969f8a", "metadata": {}, "outputs": [], "source": [ "# Strings" ] }, { "cell_type": "code", "execution_count": 35, "id": "1c09a3c6-68a6-45a6-b4a0-edc5d1534c02", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\"Hello world\"" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "a = \"Hello \"\n", "b = \"world\"\n", "# concatenation \n", "a * b" ] }, { "cell_type": "code", "execution_count": 36, "id": "68192218-f16f-4ab4-92ff-be542b4ac13b", "metadata": {}, "outputs": [], "source": [ "# Arrays" ] }, { "cell_type": "code", "execution_count": 37, "id": "86d4d2c4-1a20-4740-983d-3fd23232740e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3-element Vector{Int64}:\n", " 1\n", " 2\n", " 3" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "col_vector = [1,2,3]" ] }, { "cell_type": "code", "execution_count": 38, "id": "f842b680-4afb-4190-916f-b97d32459e3f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Vector{Int64}\u001b[90m (alias for \u001b[39m\u001b[90mArray{Int64, 1}\u001b[39m\u001b[90m)\u001b[39m" ] }, "execution_count": 38, "metadata": {}, "output_type": "execute_result" } ], "source": [ "typeof(col_vector)" ] }, { "cell_type": "code", "execution_count": 39, "id": "57424212-b8d6-44d5-ba86-5d8b5d122ce1", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1×3 Matrix{Int16}:\n", " 1 2 3" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "row_vector = Int16[ 1 2 3 ]" ] }, { "cell_type": "code", "execution_count": 40, "id": "bb947297-6f97-4b6d-ae07-e31c4f7140ba", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Matrix{Int16}\u001b[90m (alias for \u001b[39m\u001b[90mArray{Int16, 2}\u001b[39m\u001b[90m)\u001b[39m" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "typeof(row_vector)" ] }, { "cell_type": "code", "execution_count": 41, "id": "7924f983-39bd-45b4-943c-e4c18dda8d60", "metadata": {}, "outputs": [ { "ename": "LoadError", "evalue": "BoundsError: attempt to access 3-element Vector{Int64} at index [0]", "output_type": "error", "traceback": [ "BoundsError: attempt to access 3-element Vector{Int64} at index [0]", "", "Stacktrace:", " [1] getindex(A::Vector{Int64}, i1::Int64)", " @ Base ./essentials.jl:13", " [2] top-level scope", " @ In[41]:2" ] } ], "source": [ "# Julia uses 1-based indexing\n", "col_vector[0]" ] }, { "cell_type": "code", "execution_count": 42, "id": "177680cd-ae71-4c28-a0dc-2b9492c92443", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3" ] }, "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "col_vector[3]" ] }, { "cell_type": "code", "execution_count": 43, "id": "585b508a-c273-418a-bd1c-a571daa6637f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# find number of elements in vector \n", "length(col_vector)" ] }, { "cell_type": "code", "execution_count": 44, "id": "b59e8692-d310-4972-9b16-2f5d696f386b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "6" ] }, "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# sum vector elements \n", "sum(col_vector)" ] }, { "cell_type": "code", "execution_count": 45, "id": "66149669-0805-49a4-85b9-7b1054598c2c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3-element Vector{Int64}:\n", " 3\n", " 2\n", " 1" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# sort descending \n", "sort(col_vector; rev=true)" ] }, { "cell_type": "code", "execution_count": 46, "id": "02c51016-fcad-4498-ae6e-0206c018a075", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "4-element Vector{Int64}:\n", " 1\n", " 2\n", " 3\n", " 23" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# add new element to end of vector\n", "push!(col_vector, 23)" ] }, { "cell_type": "code", "execution_count": 47, "id": "aa2a3933-b50f-43b9-969f-aa0002da115f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "4-element Vector{Int64}:\n", " 1\n", " 2\n", " 3\n", " 23" ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# The ! means that the vector is modified in place\n", "col_vector" ] }, { "cell_type": "code", "execution_count": 48, "id": "1fe8a0cf-ed52-4b60-92a6-76cab0c15a3f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "23" ] }, "execution_count": 48, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# To remove last element of vector \n", "pop!(col_vector)" ] }, { "cell_type": "code", "execution_count": 49, "id": "0f453b50-0ff6-4d0d-8ed0-dee812d8a091", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3-element Vector{Int64}:\n", " 1\n", " 2\n", " 3" ] }, "execution_count": 49, "metadata": {}, "output_type": "execute_result" } ], "source": [ "col_vector" ] }, { "cell_type": "code", "execution_count": 50, "id": "2a939b2a-c249-43aa-a3a1-931848a478df", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2×3 Matrix{Int64}:\n", " 1 3 5\n", " 2 4 6" ] }, "execution_count": 50, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# construct a matrix with 2 rows 3 columns\n", "matrix = [1 3 5; 2 4 6]" ] }, { "cell_type": "code", "execution_count": 51, "id": "2f8b8f52-c58e-4fb7-89d8-edcb22da6e84", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Matrix{Int64}\u001b[90m (alias for \u001b[39m\u001b[90mArray{Int64, 2}\u001b[39m\u001b[90m)\u001b[39m" ] }, "execution_count": 51, "metadata": {}, "output_type": "execute_result" } ], "source": [ "typeof(matrix)" ] }, { "cell_type": "code", "execution_count": 52, "id": "2d9f30c5-3013-4ee4-a082-3dc1a1ef25d0", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5" ] }, "execution_count": 52, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# access element in row 1 column 3\n", "matrix[1, 3]" ] }, { "cell_type": "code", "execution_count": 53, "id": "a8fcde6a-597c-40de-9375-97f9f312f747", "metadata": {}, "outputs": [], "source": [ "# Tuples" ] }, { "cell_type": "code", "execution_count": 54, "id": "ccff89cc-3553-4a02-a903-a095885836fb", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(\"dog\", 23.4, \"cat\", 'a')" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# construct tuple\n", "t = (\"dog\", 23.4, \"cat\", 'a')" ] }, { "cell_type": "code", "execution_count": 56, "id": "635e121c-d90a-453d-873d-c05afe97c285", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Tuple{String, Float64, String, Char}" ] }, "execution_count": 56, "metadata": {}, "output_type": "execute_result" } ], "source": [ "typeof(t)" ] }, { "cell_type": "code", "execution_count": 57, "id": "93e30598-b590-45c6-9190-f424329e26ef", "metadata": {}, "outputs": [], "source": [ "# Named Tuple" ] }, { "cell_type": "code", "execution_count": 58, "id": "6a23a56c-aa9a-425c-bad2-183aa52d8734", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(name = \"eggdog\", age = 3, breed = \"egg-dog mix\")" ] }, "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dog = ( \n", " name = \"eggdog\",\n", " age = 3,\n", " breed = \"egg-dog mix\" )" ] }, { "cell_type": "code", "execution_count": 59, "id": "ed7fcf69-000f-4023-b970-2b621be719af", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "@NamedTuple{name::String, age::Int64, breed::String}" ] }, "execution_count": 59, "metadata": {}, "output_type": "execute_result" } ], "source": [ "typeof(dog)" ] }, { "cell_type": "code", "execution_count": 61, "id": "4ca36d0d-6750-4f42-9557-80a910613b4c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\"eggdog\"" ] }, "execution_count": 61, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dog[1]" ] }, { "cell_type": "code", "execution_count": 62, "id": "e35bc0f4-6a68-4444-8a30-c5d862805700", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\"eggdog\"" ] }, "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dog.name" ] }, { "cell_type": "code", "execution_count": 63, "id": "271e4433-7e55-4e19-bc43-8dd8073412ff", "metadata": {}, "outputs": [], "source": [ "# Dictionaries" ] }, { "cell_type": "code", "execution_count": 65, "id": "aff8b4fa-4d41-45d2-9228-3b299e85d73c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Dict{Any, Any} with 3 entries:\n", " \"name\" => :eggdog\n", " :age => 3\n", " 23 => \"eggdog mix\"" ] }, "execution_count": 65, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dog = Dict(\n", " \"name\" => :eggdog,\n", " :age => 3,\n", " 23 => \"eggdog mix\" )" ] }, { "cell_type": "code", "execution_count": 66, "id": "857781d3-82e0-479b-bacf-50b8fe8cf725", "metadata": {}, "outputs": [], "source": [ "# access value using key" ] }, { "cell_type": "code", "execution_count": 67, "id": "0667e7c1-103a-4dbf-9a16-dc8c1234fa1f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ ":eggdog" ] }, "execution_count": 67, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dog[\"name\"]" ] }, { "cell_type": "code", "execution_count": 68, "id": "5f8ce0e9-5506-498a-92ef-f91470fc3907", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3" ] }, "execution_count": 68, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dog[:age]" ] }, { "cell_type": "code", "execution_count": 69, "id": "c4f42e7d-1bb4-427d-8098-ebef11875b7a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Dict{Any, Any} with 3 entries:\n", " \"name\" => :eggdog\n", " :age => 3\n", " 23 => \"eggdog mix\"" ] }, "execution_count": 69, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dog" ] }, { "cell_type": "code", "execution_count": 70, "id": "e53e1188-6219-4b02-83c4-eb2cf4704fe9", "metadata": {}, "outputs": [], "source": [ "# remove key value" ] }, { "cell_type": "code", "execution_count": 71, "id": "4c5fc209-1221-49af-9ec7-6c77e971813c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "\"eggdog mix\"" ] }, "execution_count": 71, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pop!(dog, 23)" ] }, { "cell_type": "code", "execution_count": 72, "id": "c8ccaa4f-d114-4fbd-8624-1c598004e596", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Dict{Any, Any} with 2 entries:\n", " \"name\" => :eggdog\n", " :age => 3" ] }, "execution_count": 72, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dog" ] }, { "cell_type": "code", "execution_count": 73, "id": "b0aae1b0-cff5-447f-b4fd-a65a8722f1ec", "metadata": {}, "outputs": [], "source": [ "# Structs" ] }, { "cell_type": "code", "execution_count": 74, "id": "6d4f4fc4-f70b-4561-a41b-55a3514edd0f", "metadata": {}, "outputs": [], "source": [ "mutable struct Dog\n", " name::String\n", " age::Integer\n", " breed::String\n", "end" ] }, { "cell_type": "code", "execution_count": null, "id": "5a992447-ee9e-436f-aaea-c3cd44decdec", "metadata": {}, "outputs": [], "source": [ "# create struct instance " ] }, { "cell_type": "code", "execution_count": 76, "id": "3eed5126-4233-47fd-b84b-4bbb6a4887bf", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Dog(\"eggdog\", 23, \"eggdog mix\")" ] }, "execution_count": 76, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mydog = Dog(\n", " \"eggdog\",\n", " 23,\n", " \"eggdog mix\")" ] }, { "cell_type": "code", "execution_count": 77, "id": "c2b74499-6483-4c68-8cb0-05dea0504601", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Dog" ] }, "execution_count": 77, "metadata": {}, "output_type": "execute_result" } ], "source": [ "typeof(mydog)" ] }, { "cell_type": "code", "execution_count": null, "id": "c2e0b2ba-b4ed-4905-b7c7-d4f45d709c29", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Julia 1.10.4", "language": "julia", "name": "julia-1.10" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", "version": "1.10.4" } }, "nbformat": 4, "nbformat_minor": 5 }