added another dictionary-for-loop example

This commit is contained in:
Leah Hanson 2013-07-01 18:00:13 -04:00
parent 3ebd8c55fd
commit 7b21a8ae1b

View File

@ -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: