+ 1

Please tell me what's the error in python

n = int(input("Enter a number:")) if n%2==0: print("Even") else: print("odd")

19th Dec 2021, 12:24 PM
Kavyansh Dubey
Kavyansh Dubey - avatar
4 Réponses
+ 7
There is no error Make sure from indentation inside if and else statement
19th Dec 2021, 12:26 PM
Muhammad Galhoum
Muhammad Galhoum - avatar
+ 3
This is just an indentation problem
20th Dec 2021, 5:46 PM
Kidus
Kidus - avatar
+ 2
I agree with Muhammad, just hit tap before the print function and you good to go
20th Dec 2021, 8:31 AM
Mohammed Alimam
Mohammed Alimam - avatar
+ 2
As Muhammad said to you your code is correct but you have to be very careful because python uses indentation instead of { block code} for other programming languages
21st Dec 2021, 1:07 AM
Rufai Limantawa