Iam getting an continue error in this code. How can i solve it? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Iam getting an continue error in this code. How can i solve it?

https://code.sololearn.com/cKbEuIUURjaH/?ref=app

16th Dec 2020, 7:09 AM
Biswajit
3 Antworten
+ 3
#You do not need "continue" before if statements and the if statements should be inside the while loop while fighting: monster = monster - 1 print('you attacked a monster') print( monster) if monster == 15 : print('it is weakned') print(monster) continue elif monster == 10: print('almost dead') print(monster) continue elif monster <= 0 : print('dead') break Here for another version👇 https://code.sololearn.com/cGdt8RagvOCi/?ref=app
16th Dec 2020, 7:24 AM
noteve
noteve - avatar
+ 2
Thank you very much
16th Dec 2020, 8:40 AM
Biswajit
+ 1
poor monster 😢
16th Dec 2020, 12:50 PM
Ratnapal Shende
Ratnapal Shende - avatar