+ 2

difference between input and print functions

8th Aug 2016, 9:50 AM
Penugonda Akash
Penugonda Akash - avatar
3 ответов
+ 3
classically, input requests information from the user, and print displays information back to the user
8th Aug 2016, 9:59 AM
Izz
Izz - avatar
- 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?
8th Aug 2016, 10:13 AM
Izz
Izz - avatar