Jul-15-2018, 08:02 PM
Why is a basic print statement asking for string formatting?:
#!/usr/bin/env python3 #PracticePythonExercise02.py number = input("Enter a number: ") if number % 2 == 0: print("the number is even.") else: print("the number is odd.")Error:>>> ================================ RESTART ================================ >>> Enter a number: 4 Traceback (most recent call last): File "F:/Python/Python36-32/SamsPrograms/PracticePythonExercise02.py", line 6, in <module> if number % 2 == 0: TypeError: not all arguments converted during string formatting >>> 