+ 1
For the Gotham city challenge my Python code not working properly please assist
num = int(input("Enter the number of villans: ")) if num < 5: print ("i got this") if 5 =< num && num <= 10: print ("Help me Batman") if num > 10: print ("Good luck out there!")
4 Answers
+ 11
if num<5:
#code
elif 5<=num<=10:
#code
else:
#code
I think you need to learn Python before attempting this in Python. You use "and" to represent an 'and' keyword, not '&&'.
In addition, you need to use indentations appropriately.
Edit: Gordon also has a point. You text needs to be EXACTLY as what is given in the question. Any alteration of characters results in an incorrect output.
+ 7
You have to follow the required output text strictly. For example "this!" and "Luck"
For posting a Code Coach challenge question/answer, we should not disclose the solution.
https://www.sololearn.com/post/232552/?ref=app
+ 2
Thank you for your quick response. Can you please elaborate a bit more?
+ 1
Thank you sir for your advice. Yes I am a novice and still learning things. Thank you once again. This will help me to grow as a coder