This question already has an answer here:
- How can I read inputs as integers in Python? 11 answers
I'm trying to generate a random integer between a specified minimum and maximum.
maxlength = input("Maximum length? \n >")
minlength = input("Minimum length? \n >")
import random
length = random.randint(minlength,maxlength) #this line does not work, says the arguments need to be integers
print (length)
Any ideas what I can do?
Aucun commentaire:
Enregistrer un commentaire