From 7b21a8ae1bdd909b9923290f588ffae17ea960a5 Mon Sep 17 00:00:00 2001 From: Leah Hanson Date: Mon, 1 Jul 2013 18:00:13 -0400 Subject: added another dictionary-for-loop example --- julia.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/julia.html.markdown b/julia.html.markdown index c6e54f70..222a490a 100644 --- a/julia.html.markdown +++ b/julia.html.markdown @@ -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: -- cgit v1.2.3