3 Respuestas
+ 5
# First, define a variable.
x = input("Enter a number in the range m to n: ")
# Then, define a range for variable x using while loop
while(x < m or x > n):
x = input("Re-enter a number in the range m to n: ")
# Therefore, while loop will end when x will come in the specified range!
# Better to use Python 3, cuz in SL editor, re-input never works ;)
0
Thank you so much Blue,
However, there is no way to take the input in a range at once?
0
I want to take input in the range 1-100 how do I do that?