Gothom code coach | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 4

Gothom code coach

I dont know the error of test 4 and 3 some one help !!!! criminals = int(input()) if criminals < 5 : print("I got this!") if 5 <= criminals < 10 : print("Help me Batman") if criminals > 10 : print("Good Luck out there") here is my code

17th Dec 2023, 6:24 PM
Mohammad sajad Ghiyasi
Mohammad sajad Ghiyasi - avatar
6 ответов
+ 8
Mohammad sajad Ghiyasi , additional to the comments from StuartH , we should not use 3 individual if... conditions. > use if... elif... else
17th Dec 2023, 7:01 PM
Lothar
Lothar - avatar
+ 5
Hi Mohammad, the punctuation in the output is very important to pass the coaches. The last line needs an "!" At the end. Look again at your condition statements. You have no condition that activates if the number is exactly 10.
17th Dec 2023, 6:57 PM
StuartH
StuartH - avatar
+ 1
Thanks a lot Stuart !
17th Dec 2023, 7:00 PM
Mohammad sajad Ghiyasi
Mohammad sajad Ghiyasi - avatar
+ 1
Thanks Lothar but it worked 💪 by the way thanks for the tip !!!
17th Dec 2023, 7:03 PM
Mohammad sajad Ghiyasi
Mohammad sajad Ghiyasi - avatar
+ 1
#updated code print("How many criminals in the world") criminal = int(input()) if (criminal < 5): print("I got this!") elif (criminal <= 10): print("Help me Batman") elif (criminal > 10): print("Good Luck out there")
18th Dec 2023, 9:40 AM
Veera Ishaan
Veera Ishaan - avatar
0
Thanks Veera Ishaan it worked 💪 by the way the Good Luck out there needs a (!) and that was the only problem
18th Dec 2023, 9:42 AM
Mohammad sajad Ghiyasi
Mohammad sajad Ghiyasi - avatar