mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-23 06:03:07 +03:00
added another dictionary-for-loop example
This commit is contained in:
parent
3ebd8c55fd
commit
7b21a8ae1b
@ -269,6 +269,10 @@ for a in ["dog"=>"mammal","cat"=>"mammal","mouse"=>"mammal"]
|
||||
println("$(a[1]) is $(a[2])")
|
||||
end
|
||||
|
||||
for (k,v) in ["dog"=>"mammal","cat"=>"mammal","mouse"=>"mammal"]
|
||||
println("$k is $v")
|
||||
end
|
||||
|
||||
|
||||
# While loops go until a condition is no longer met.
|
||||
# prints:
|
||||
|
Loading…
Reference in New Issue
Block a user