0
How to make code to pick random number
I want to make a code which will when you enter for example 2 name and it shows a random number.
3 Réponses
+ 6
Boske - Football , it is clear what you want, but not in all details. You mention that you will enter 2 names. OK - no problem. Then a random number should be created. I am rather sure, that this number has to be in a range from n to n1. Please give us more information. Thanks!
+ 5
You can import the 'random' module and the use one of its methods, e.g. randint().
Have a look at https://www.w3schools.com/JUMP_LINK__&&__python__&&__JUMP_LINK/module_random.asp
+ 1
From random import randint
x = int(input())
y = int(input())
z = randint(x, y)
print(z)
Input 2 numbers and it will pick a number in between those 2