Posts by Dérick Ramos • 81 points
3 posts
-
1
votes1
answer458
viewsQ: What is the equivalent of "from" and "import" (PYTHON) in Ruby?
I would like to call a script through another script. In Python I use the commands "from" and "import", but which command would be equivalent to do this in Ruby?
-
0
votes3
answers1358
viewsQ: How to create a variable through the answer typed by the user in Python?
For example, we can use this code to assign the value to a variable: idade = input('Digite sua idade: ') What I’d like to know is, if instead of assigning a value a variable is possible to create a…
-
5
votes1
answer1868
viewsQ: How to randomly choose an item from a Python dictionary?
I would like to know how to randomly choose an item from a Python dictionary? For example: I have the dictionary dic = {'Pedro': 99, 'João': 19, 'Rosa': 35, 'Maria': 23} and need to choose an item…