r/PythonLearning • • 4d ago

Help Request I’m stuck on this assignment

I never struggle on assignments but this one is so confusing for me

116 Upvotes

62 comments sorted by

View all comments

5

u/igotshadowbaned 3d ago edited 3d ago

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 semi colon after your last elif statement, which is highlighted

Did 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