Ever played Pokemon and chosen a funny name so that the in-game messages would come out funny?
In Python we can create strings that contain dynamic values with the f-string syntax.
num_bananas = 10
f_string = f"You have {num_bananas} bananas"
print(f_string)
# You have 10 bananas
f
.Fix the bug on line 7. Use an f-string to inject the dynamic values into the string:
NAME
with the value of the name
variableRACE
with the value of the race
variableAGE
with the value of the age
variableDo not "hard-code" the values into the string. For example, this is not the solution we're looking for (even though it happens to work in this case):
print("Yarl is a dwarf who is 37 years old.")
We need the player to see their values.
Punctuation matters! Make sure your output matches the expected output exactly.
Focus Editor
Alt+Shift+]
Login to Submit
Login to Run
Login to view solution