+ 2

Help me please. / Помогите мне пожалуйста.

x = input("") if int(x) > 7: print("qwerty") elif int(x) == 7: print("123456") elif int(x) < 7: print("Access") elif int(x) == 9: while int(x) <= 19: print(x) x = int(x) + 1 How to make sure that "qwerty" is not printed, if the input is 9? / Как сделать чтобы не печаталось "qwerty", если ввод 9?

23rd Apr 2018, 3:24 PM
Telyne
Telyne - avatar
3 odpowiedzi
+ 7
Just add another condition to it. if int(x) > 7 and int(x) != 9: print("qwerty")
23rd Apr 2018, 3:36 PM
Dev
Dev - avatar
+ 4
put the x==9 condition on top
23rd Apr 2018, 7:19 PM
Mitali
Mitali - avatar
+ 3
Or: Help me please. / Помогите мне пожалуйста. x = input("") if x == 9: while int(x) <= 19: print(x) x = int(x) + 1 elif int(x) > 7: print("qwerty") elif int(x) == 7: print("123456") elif int(x) < 7: print("Access")
23rd Apr 2018, 5:03 PM
Emma