Even or odd without condition statement | SoloLearn: Learn to code for FREE!

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.

2/14/2019 12:59:00 PM

Uthpala

5 Answers

New Answer

+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