+ 1
How do how do you make random numbers with python?
I’m trying everything thing and it’s still not working 😓
8 Réponses
+ 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)) )
+ 1
Pls share your try ..
+ 1
Idk i used like random function and randit function but it wasnt working
+ 1
Oh i never used the
Import
Part ahhhhh
+ 1
Ok thank you! This was very helpful 😁
+ 1
I tried it and it worked!
Thank you.
+ 1
Next time share your code.. then You can get quick answers.
You're welcome...
+ 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)