case look
when 'side'
hash1 = {
'num' => 5,
'style' => 'sideStyle',
}
when 'front'
hash1 = {
'num' => 8,
'style' => 'frontStyle',
}
when 'back'
hash1 = {
'num' => 4,
'style' => 'backStyle',
'special' => 'yes',
}
else
hash1 = {
'num' => 2,
'style' => 'noStyle',
}
end
myStyle = Hash[hash1]
My piece of code looks like this.
when I run this code I get "odd number of arguments for Hash".
is this the correct way to from an hash? could someone please help me how to get it resolved.
Aucun commentaire:
Enregistrer un commentaire