On python how do i prompt a user to enter a number but the program is only inclusive for a certain range. For example, prompting the user to enter a number (inclusive with integers between 0 and 10)?
# Code n = int(input("Enter a number between 0 and 10 inclusive: ")) while not(n>=0 and n<=10): print("Invalid input") n = int(input("Enter a number between 0 and 10 inclusive: ")) print("Valid number is",n)
Get Answers For Free
Most questions answered within 1 hours.