Intermediate Julia
Anthony Markham
Quantitative Developer
mutable struct House
bedrooms::Int64
bathrooms::Int64
location::String
price::Float64
end
my_house = House(3, 2, "Sydney", 1500000)
mutable struct Person
age::Int64
height::Int64
location::String
function Person(age, height)
new(age, height, "London")
end
end
steve = Person(19, 180)
Person(19, 180, "London")
function arg_types(pos, ; key)
return pos, key
end
function vararg_names(names...)
return names
end
function return_x_times_y(x, y)
return x * y
end
Functions are flexible and writing your own functions is an essential part of programming.
Practical, real-world problem solving is a key part of learning to code.
Intermediate Julia