• Cours
  • Compilateur de code
  • Discuter
  • Tarification
  • Équipes
Menu
+ 7

Ruby equivalent .items() method?

Is there a Ruby equivalent of the Python dictionary ".items()" method that returns a list of (key, value) pairs of a hash?

methodsrubypython3
20th Mar 2017, 3:56 AM
David Ashton
David Ashton - avatar
2 Réponses
+ 2
You can use the to_a method of hash
25th Mar 2017, 3:03 PM
Steven Wang
Steven Wang - avatar
+ 1
to_a method will do the trick
24th Apr 2017, 1:33 PM
Zafor Iqbal
Zafor Iqbal - avatar

Vous avez souvent des questions comme celle-ci ?

Apprenez de maniĂšre plus efficace, gratuitement :

  • Introduction Ă  Python

    7.1M apprenants

  • Introduction Ă  Java

    4.7M apprenants

  • Introduction Ă  C

    1.5M apprenants

  • Introduction Ă  HTML

    7.5M apprenants

Voir tous les cours
Aujourd'hui en vedette
Is this realistic enough?
1 Votes
đ™”đ™žđ™œđ™ł đšƒđ™·đ™Ž đ™žđ™œđ™żđš„đšƒ đ™Ÿđ™” đšƒđ™·đ™Ž đ™żđšđ™Ÿđ™¶đšđ™°đ™Œ
1 Votes
"Which is harder to master — Machine Learning or Cybersecurity? And why?"
1 Votes
"What’s the best way to combine creativity and coding? Can storytelling improve web apps?"
1 Votes
Need friends
0 Votes
MASS N NUMBER OF OBJECT DELETION FROM A CLASS
0 Votes
Can someone explain inline and block elements please
0 Votes
I am a beginner, please teach me how to use Python
0 Votes
Python
1 Votes
Can u learn multiple language at the same time, without misplacing the formats of each with the other
0 Votes