[Solved] Help - python - Deja Brew

potionsOnTheWall = 10
numToTakeDown = 1
while True:
hero.say(potionsOnTheWall + " potions of health on the wall!")
# Sing the next line:
hero.say(potionsOnTheWall + " potions of health!")
# Sing the next line:
hero.say(“Take " + numToTakeDown + " down, pass it around!”
potionsOnTheWall -= numToTakeDown
# Sing the last line:
hero.say(potionsOnTheWall + " potions of health on the wall.")

Looked at loads of forum posts on this but still can’t see what is wrong with mine? It doesn’t work and freezes on count 5. It also says cannot read undefined start at the beginning?

Learn how to format your code properly and read this topic carefully : Deja Brew (code doesn’t work)

1 Like
# You can add strings together, and add numbers into strings.
# Sing along, using string concatenation:
# X potions of health on the wall!
# X potions of health!
# Take Y down, pass it around!
# X-Y potions of health on the wall.

potionsOnTheWall = 10
numToTakeDown = 1
while True:
    hero.say(potionsOnTheWall + " potions of health on the wall!")
    # Sing the next line:
    pet.say(potionsOnTheWall + " potions of health!")
    # Sing the next line:
    hero.say("Take " + numToTakeDown + " down, pass it around!")
    potionsOnTheWall -= numToTakeDown
    # Sing the last line:
    hero.say(potionsOnTheWall + " potions of health on the wall.")

This is super frustrating, I already finished the Backwords Forest and this is one of the only levels I have left. I sing each line the same as the others and it says I didn’t. What is my problem?

Your hero has to say it.

1 Like