0

Hi! i need guide on here Because I don't know why I can't solve it, I just used what I learned on my progress

You are a police officer, and you get a report of criminal activity! Should you go on your own, or should you call a superhero to help you fight the crime? If there are less than 5, you can handle this on your own, if there are 5-10, you will want to go with Batman for backup, and if there are more than 10, you should stay where it is safe and let Batman handle this on his own! Task: Determine whether you need to call backup based on the total number of criminals being reported. Input Format: An integer that represents the total number of criminals present at the scene. Output Format: A string that says 'I got this!', 'Help me Batman', or 'Good Luck out there!' depending on the scenario. Sample Input: 7 Sample Output: 'Help me Batman' My code: criminals = int(input()) if criminals < 5: print("I got this!") elif criminals > 5: print("Help me Batman!") else: print("Good Luck out there!")

9th Apr 2025, 5:08 PM
Justin Rei Cargullo
Justin Rei Cargullo - avatar
2 Antworten
+ 8
Bronyth , there are some issues with the *code logic*. > the code uses: ...<5 and ...>5 . but what about if the number is exactly 5 ? > check all conditions > there is also an issue with the *output* string.. >> please read the instructions from the task description carefully and try to fix the issues.
9th Apr 2025, 5:19 PM
Lothar
Lothar - avatar
+ 6
You will never reach the else part because elif criminals > 5 will be true for all numbers > 5 And as Lothar mentioned what about criminals = 5?
9th Apr 2025, 5:30 PM
Denise Roßberg
Denise Roßberg - avatar