you can use the length method on hashes just as you can on arrays. : Hash Length Hash Ruby


pizza = {"first_topping" => "pepperoni", "second_topping" => "sausage"}
puts pizza.length