+ 2
difference between input and print functions
3 ответов
+ 3
classically, input requests information from the user, and print displays information back to the user
- 1
def main():
while true:
try:
numIn = int(input("Please enter an integer: "))
break
except ValueError:
print("I'm sorry, the value you entered is not a valid number. Please try again.")
if numIn%2 == 0:
print("The number you entered is even.")
else:
print("The number you entered is odd.")
main()
please excuse minor syntax issues...you get the idea though, right?