Find out the errors in following code:
>>>number=int(input(‘enteranintegernumber:”))
>>>if(number%2)==0
Print number is even
Else
Print number is odd
Answers
Answered by
0
Answer:
1. Incorrect punctuation: 'input(‘enteranintegernumber:")' should be 'input("enteranintegernumber:")'
2. Missing a colon after the if statement: 'if(number%2)==0' should be 'if (number%2)==0:'
3. Incorrect indentation: 'Print number is even' and 'Print number is odd' should be indented so they're in the correct scope.
Explanation:
The explanation is in the answer section
Similar questions