-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasics.jl
More file actions
17 lines (14 loc) · 810 Bytes
/
basics.jl
File metadata and controls
17 lines (14 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
print("hello world") #double quotes for strings
println(" more hello") #continue printing on that line but start a new one
x = 5 #comments
#can do all kinds of updating operators
x += 5 #add equal operation
x /= 2 #divide equal operation
x %= 2 #remainder operation with update operator
println("remainder of 5 divided by 2 is ", x)
α = "alpha" #alpha character can be used as a variable
η = "eta" # as well as other characters by doing \eta then tab
array = [1,2,3].^3 #dotwise operation as well as printing
array .+= 1 #dot wise combined with update equal operator
println(array[1]) #print the first value from the array (arrays start at 1!)
println(array)