+ 1

How do how do you make random numbers with python?

Iā€™m trying everything thing and itā€™s still not working šŸ˜“

13th Feb 2022, 12:03 PM
The Coder
The Coder - avatar
8 Answers
+ 2
If you show the code, then it helpful to find mistakes if any..!!!! Here see Coder2.0 import random print( random.random() ) print( random.randint(1,10) ) print( random.choice(range(20)) )
13th Feb 2022, 12:57 PM
Jayakrishna šŸ‡®šŸ‡³
+ 1
Pls share your try ..
13th Feb 2022, 12:12 PM
Jayakrishna šŸ‡®šŸ‡³
+ 1
Idk i used like random function and randit function but it wasnt working
13th Feb 2022, 12:50 PM
The Coder
The Coder - avatar
+ 1
Oh i never used the Import Part ahhhhh
13th Feb 2022, 1:13 PM
The Coder
The Coder - avatar
+ 1
Ok thank you! This was very helpful šŸ˜
13th Feb 2022, 1:14 PM
The Coder
The Coder - avatar
+ 1
I tried it and it worked! Thank you.
13th Feb 2022, 1:17 PM
The Coder
The Coder - avatar
+ 1
Next time share your code.. then You can get quick answers. You're welcome...
13th Feb 2022, 1:26 PM
Jayakrishna šŸ‡®šŸ‡³
+ 1
You must first import random module then use ranint(x,y) which returns a number between x and y inclusively Code example: from random import ranint myRandomNumber = ranint(1,10)
13th Feb 2022, 5:37 PM
Muhammad Abouraya
Muhammad Abouraya - avatar