can you use a or in an if else statement | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

can you use a or in an if else statement

num = input() if num == 7 or num == 8: print("good job it's either 7 or 8") else: print("guess again")

26th Mar 2019, 1:20 AM
Hacked JJSJSJS
Hacked JJSJSJS - avatar
2 ответов
+ 3
That is okay but you have to first convert input to int then you can compare them for equality with 7/8
26th Mar 2019, 3:23 AM
Saksham Jain
Saksham Jain - avatar