(9/10)

Your First Function (Functions) — Python typing lesson

Create reusable functions to organize your code.

What you'll practice

Let's teach our robot a new trick! A function is a block of code we can name and use over and over.

  • `def` is the keyword to define a new function.
  • The code inside the function must be indented.
🐍Python

Your First Function (Functions)

0 WPM
0% Accuracy
0:00 Time elapsed
1
2
3
4
5
6
def say_hello():↵
print('Hello there!')↵
print('Welcome to the world of functions!')↵
↵
say_hello()↵
say_hello()
0 / 115
Press This!
👇
`~
1!
2@
3#
4$
5%
6^
7&
8*
9(
0)
-_
=+
⌫
⇥
Q
W
E
R
T
Y
U
I
O
P
[{
]}
\|
⇪
A
S
D
F
G
H
J
K
L
;:
'"
↵
⇧
Z
X
C
V
B
N
M
,<
.>
/?
⇧
Thumb
Index
Middle
Ring
Pinky