irb(main):033:0* d={"a"=>"x","b"=>"y","c"=>"z"} => {"a"=>"x", "b"=>"y", "c"=>"z"} irb(main):052:0> d.each_with_index{|(k,v),i|puts "key: %s, value: %s, index: %i"% [k,v,i]} key: a, value: x, index: 0 key: b, value: y, index: 1 key: c, value: z, index: 2 => {"a"=>"x", "b"=>"y", "c"=>"z"}
Halloween - 2024
3 weeks ago
No comments:
Post a Comment