QUESTION IMAGE
Question
1.4.3. reassigning variables
content
introduction to computer science
variables
watch the video
00:00 / 04:07
fixing an error in a game
message
oh no we have an error! can you fix it?
your task: go ahead and fix the error in the program in the code editor so that there is no error.
main takeaways
Step1: Identify the error
The variable player is used in the print statements but is not defined.
Step2: Fix the error
We can either define player or use the defined hero variable instead. Here we use hero:
hero = "Josephine"
print("Welcome to Planet Python, " + hero + "!")
print("Congratulations, " + hero + " you are the hero!")Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
hero = "Josephine"
print("Welcome to Planet Python, " + hero + "!")
print("Congratulations, " + hero + " you are the hero!")