CodeAgeBy Sitezack
Python for Builders — Level 4Functions and lists0 XP
Chapter progress0/6

Lesson 3 of 7

Functions with several ingredients

A function can take several parameters, separated by commas: def force(attack, bonus).

Inside, you combine the parameters just like normal variables.

def total(a, b):
    return a + b

print(total(3, 4))

🎯 Your mission

Write a function force(attack, bonus) that returns attack + bonus * 2 (every bonus counts double!), then print force(5, 3).

PRO lesson

This advanced chapter is part of CodeAge PRO. Unlock it to keep your adventure going.

Discover PRO