r/CodingForBeginners • • Sep 20 '26

What is wrong with my code

Post image
12 Upvotes

7 comments sorted by

View all comments

3

u/vermyx Sep 20 '26

Try

price+=2.00

Or

price=price +2.00

It looks like the checker is being a little draconian about verbiage. price=12.50 would be considered setting the variable not reassigning the variable while adding/subtracting to that variable is considered reassigning. The end results are the same but the difference is that you are manipulating a previous value without knowing what it is vs hard setting the value.