runtric-logo
Python Basic 1 - Getting StartedObject Types in Python (3/4)
Chapter 3
Python Basic 1 - Getting Started

Object Types in Python

6 minutes read

Beginner friendly

Includes practice

Meet Python’s Built-in Object Types 🎲📦

Hi there! Every piece of data in Python lives inside an object—think of objects as Lego bricks you snap together to build programs.
Today you’ll meet the most common brick shapes (object types) you’ll use every day.

What Does “Object Type” Mean?

  1. Object – a chunk of data stored in memory (number, word, list …).
  2. Type – the label that tells Python how that chunk behaves (can you add it, loop over it, etc.).

Example Code

Interactive Code Editor
python

This won’t affect your saved progress.

So, age is an object; int (integer) is its type.

Quick Summary

  • Everything in Python is an object with a specific type

  • Knowing the type tells you what you can do with the value

  • Use type(value) to ask Python directly

Core Simple Types

a. Numbers

Example Code

Interactive Code Editor
python

This won’t affect your saved progress.

You can add, subtract, multiply—like a calculator.

b. Booleans

Example Code

Interactive Code Editor
python

This won’t affect your saved progress.

Only two possible values; great for yes/no questions.

c. Text (Strings)

Example Code

Interactive Code Editor
python

This won’t affect your saved progress.

A string is a series of characters inside quotes.

Collection Types – Holding Multiple Values

a. Lists (changeable)

Example Code

Interactive Code Editor
python

This won’t affect your saved progress.

b. Tuples (fixed)

Example Code

Interactive Code Editor
python

This won’t affect your saved progress.

c. Dictionaries (key → value pairs)

Example Code

Interactive Code Editor
python

This won’t affect your saved progress.

Python also has sets for unique items, but we’ll focus on the big three above.

Mutable vs Immutable (Plain English)

  • Mutable = can change inside the same object (list, dict)
  • Immutable = frozen; any “change” makes a brand-new object (int, str, tuple)

Peek Inside with type() and len()

Example Code

Interactive Code Editor
python

This won’t affect your saved progress.

type() tells what it is, len() (for many collections) tells how big.

Hands-On Practice – Play with Types

Practice Challenge

Interactive Code Editor
📝 Your Task:

Add the color "yellow"to the list so that it contains four colors in total. After appending, store the list length in color_list_lengthand print it.

python

Append the color "yellow" to the list, then print len(colors).

Runtic's Learning Tips

  • When unsure, print type(value)—debugging super-power for beginners

  • Convert values to other types to experiment: int("8"), str(3.14)

  • Build a mini address book using a dictionary; add, read, and update contacts to cement the idea

Quick Knowledge Check

Quick Practice

3 minutes

Identify the Type!

What type is '42'? (quotes included)

[1, 2, 3] belongs to which type?

Is a tuple mutable or immutable?

Lesson Complete!
100%
Progress
What You've Learned:
  • You created and called functions, mastering def, parameters, and return
  • You imported modules (math, random) and understood how packages organise reusable code
  • You reinforced learning through quizzes, live-code practice, and growth-mindset tips—keep reusing and organising your own code!

Sign in to track your progress

Chapter Progress

0 secs

AI Tutor

Powered by Runtric

Solve first — tutor's here to guide.

Runtric might be wrong. Think critically.