(1/10)

Building Blueprints — Python typing lesson

Learn about classes - blueprints for creating objects.

What you'll practice

Let's learn about classes! A class is like a blueprint for creating objects. We can use it to design our own Pet!

  • `class Pet:` starts the blueprint for our Pet.
  • `__init__` is a special function that runs when we create a new pet. It sets up the pet's properties.

Pro Access Required

This is a premium lesson. Upgrade to Pro to unlock this interactive exercise and continue your learning journey.

🐍Python

Building Blueprints

0 WPM
0% Accuracy
0:00 Time elapsed
1
2
3
4
5
6
class Pet:↵
def __init__(self, name, animal_type):↵
self.name = name↵
self.animal_type = animal_type↵
↵
print('Blueprint created!')
0 / 146
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