r/PythonLearning • u/Hefty_Courage3893 • Oct 15 '26
Help Request I’m stuck on this assignment
I never struggle on assignments but this one is so confusing for me
132
Upvotes
r/PythonLearning • u/Hefty_Courage3893 • Oct 15 '26
I never struggle on assignments but this one is so confusing for me
View all comments
4
u/igotshadowbaned Oct 16 '26 edited Oct 19 '26 •
For print, if you want it to just print text as a string, you need to put it in quotes
print("You earned a bonus")
If you want to also print a variable, you put it in the list within the function call
print("You earned a bonus", str(bonus_1)
You can alternatively combine the strings first
string = "You earned a bonus" + str(bonus_1)
print(string)
But your syntax is currently the problem.
You do do it correctly later. And then also use fstrings.
You're also missing a
semicolon after your last elif statement, which is highlightedDid you try using AI to write this? I'm just confused how else you would have correctly written sections that do the same thing, but then not be able to figure why it isn't working 6 lines above that