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
函式很有彈性,自己撰寫函式是程式設計的基本功。
動手解決真實問題是學習寫程式的關鍵。
Julia 中級