我有以下代码:
person1 = { :first => "bob", :last => "perry"}
person2 = { :first => "fred", :last => "perry"}
person3 = {:first => "jane", :last =>"perry"}
family = {:dad => person1, :son => person2, :mum => person3}
puts (family[:dad][:last],family[:dad][:first])
它打印出来:
perry
bob
nil
为什么它也输出nil?