Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Using Functions | Functions
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Python Ninja
Section 3. Chapter 1
ninja.py

ninja.py

index.html

index.html

preset.py

preset.py

bookUsing Functions

Swipe to show menu

Why Use Functions?

Repeating code makes programs long and hard to maintain. Functions let you group commands into a reusable block, reducing repetition and making your code cleaner.

To call a function, simply use its name followed by parentheses, placing any required arguments inside those parentheses. For example, if you have a function named greet that takes a name of a person to greet, here is how you could call it:

greet("Alice")
Task

Swipe to start coding

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 1
ninja.py

ninja.py

index.html

index.html

preset.py

preset.py

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt