7 of 8
📦 Functions
Part A: Make a function show_health(name, hp) that prints "[name] has [hp] HP". Call it 3 times.
Part B: Make a function calc_damage(base, multiplier) that returns base × multiplier. Call it and print the result.
Part C:
player_hp = 100 damage = calc_damage(15, 2) # Calculate damage player_hp = player_hp - damage # Subtract it show_health("Hero", player_hp) # Show new health
=== Part A ===
Steve has 100 HP
Alex has 75 HP
Creeper has 20 HP
=== Part B ===
Damage: 30
=== Part C ===
Hero has 70 HP