2017-06-11から1日間の記事一覧
hash pythonでいうならdictionary。 h={'one'=>1,'two'=>2,'three'=>3} puts h puts h['three'] 出力は以下。 {"one"=>1, "two"=>2, "three"=>3} 3 num={a:1,b:2,c:3,d:4,e:5} num.each { | k, v | puts "key is #{k} ,and value is #{v}"} 出力は以下。 key…
hash pythonでいうならdictionary。 h={'one'=>1,'two'=>2,'three'=>3} puts h puts h['three'] 出力は以下。 {"one"=>1, "two"=>2, "three"=>3} 3 num={a:1,b:2,c:3,d:4,e:5} num.each { | k, v | puts "key is #{k} ,and value is #{v}"} 出力は以下。 key…