0
Even or odd without condition statement
x=input('enter any number: ') y=x%2 print (book(y)) I'm trying to say whether given number is even or odd using Boolean. but I'm getting error.....help me with this.
5 Antworten
+ 2
print(bool(y)) not book!
+ 2
You need to convert the input into int first with int(x).
+ 1
sorry typo error...I have given bool
+ 1
Thanks HonFu :)
0
got it