Code Monsters Academy
Home › Course contents › Level 8 - Tag-Team Battle
Putting it together: lists + loops

Level 8 - Tag-Team Battle

Chapter 2 · Monster League

Loop over the team with for, and have each member attack() once when it's their turn:

for m in team:
    print(m, "go!")
    attack()
GoalThe team has 4 members. Each tackles once to defeat the Bristusk (40 HP).
TipBoth lines under for need 4 spaces.
Starting code
team = ["{PET}", "Lilywhisp", "Reefclaw", "Dunebun"]
# Use for to make each member say "Name go!" and tackle once
Practise this in the game
← Previous levelLevel 7 - Both at Once