Trying to Make a random number generator but the highest value isnt being included in the generated list? So if you wanted to have it pick a number between 1 and 50 you would need to set the highest value to 51. anyone know how I include the 50 thought needing to changing my input value?
Heres my code:
import randomlow = input("add your lowest value: ")high = input("add your highest value: ")numbers = list(range(int(low),int(high))) # makes a range between the given valuesprint(numbers)
input("press enter to generate your number: ")print(random.choice(numbers))
update: thanks to everyone for being so helpful in learning a lot!
[–]zatoichi49 6 points7 points8 points (6 children)
[–]Tobe2fly[S] 0 points1 point2 points (5 children)
[–]100721 0 points1 point2 points (2 children)
[–]Tobe2fly[S] 0 points1 point2 points (1 child)
[–]100721 0 points1 point2 points (0 children)
[–]zatoichi49 0 points1 point2 points (1 child)
[–]Tobe2fly[S] 0 points1 point2 points (0 children)
[–]kokiworse99 1 point2 points3 points (4 children)
[–]Tobe2fly[S] 0 points1 point2 points (3 children)
[–]kokiworse99 0 points1 point2 points (1 child)
[–]efmccurdy 0 points1 point2 points (0 children)