✦ Python Foundations Functions module

Concept 16 · Parameters & Arguments

Give functions input.
Use arguments when calling.

A parameter is the name inside a function definition; an argument is the value supplied when the function is called.

01 Learn02 Try03 Predict

Parameters let one function work with different values.

A parameter is the name inside a function definition; an argument is the value supplied when the function is called.

def greet(name):
    print("Hello,", name)

greet("Ana")
greet("Marko")

name is a parameter. "Ana" and "Marko" are arguments passed into the same function.

Change one value or function call, then explain how the result changes.

↳

Keep this in mind: Read the function definition and its calls before predicting the result.

Try it
def greet(name):
    print("Hello,", name)

greet("Ana")
# Change an argument and add another call

Run the example, then change one value and observe the result.

Python Playground

Loading Python runtime…

Edit the example and run it in your browser.

parameters_and_arguments.pyPython
OutputWaiting for Python
The browser runtime is loading. You can still edit the example code.

Pyodide runs Python in a browser Web Worker. It is stopped and restarted if code keeps running. Browser execution is not a complete security boundary; do not enter secrets or rely on it for untrusted code isolation.

What will this program print?

Read the function definition and each call before choosing an answer.

def introduce(name, city):
    print(name, "lives in", city)

introduce("Ana", "Novi Sad")
Choose the output
Sloby, the Python AI Tutor mascot

Your learning mentor

Ask Sloby about this concept

Describe what feels unclear and Sloby will guide your reasoning.

Hi! I'm Sloby. Let's explore this Python concept together.

What will this program print, and how can the same function use different arguments?

def add_tax(price, rate=0.2):
    print(price + price * rate)

add_tax(100)
add_tax(100, 0.1)
Python AI Tutor · Learn by understanding, not just by running code.