I'm a beginner in coding and started because it's part of my course. I tried to make a function called displayOptions responsible for displaying options to the user and asking them for input from 1 to 7. Input such as string or numbers above 7 or below 1 should be rejected and the error message should be displayed.
def displayOptions():
#This part of the function is supposed to just print, and it's working correctly.
print ("Please select one of the following options:"), print ("1. Teaspoon to metric"), print ("2. Tablespoon to metric"), print ("3. Fluid ounces to metric"), print ("4. Pint to metric"), print ("5. Display list"), print ("6. Help"), print ("7. Close")
#Here I tried to make a loop until the user picks a number from 1 to 7 however the loop doesn't stop when the numbers are entered.
while True:
int(input) == (1, 7)
break
print("this is not a valid input, try to use a number from 1 to 7")
pass
pass