Variables and Data Types
Understanding variables, strings, integers, and floats
Variables and Data Types is a free Python For Kids lesson on CoddyKit — lesson 1 of 3. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Python For Kids learning path, one of 3 lessons in the course, and your progress syncs across the web and the CoddyKit app.
1
Variables and Data Types
Welcome to the world of Python! Today, we'll learn about variables and the different types of data you can use in your programs.

2
What is a Variable?
A variable is like a labeled box that holds information. You can use variables to store numbers, words, and more, making it easier to work with data in your programs.
3
Creating a Variable
To create a variable in Python, you just need to give it a name and assign a value to it using the equals sign (=).
4
Example of a Variable
Let's look at some examples of variables in Python:
message = "Hello, Python!"
number = 10
pi = 3.145
Data Types in Python
Data types tell Python what kind of information you're working with. Let's explore the most common ones:
- String (str): Text enclosed in quotes.
- Integer (int): Whole numbers without decimals.
- Float (float): Numbers with decimals.
6
Strings
Strings are used to store text. You can create a string by enclosing characters in single (') or double (") quotes.
Here are some examples:
greeting = "Hello, World!"
name = 'Alice'7
Integers
Integers are whole numbers without any decimal points. They can be positive or negative.
Examples of integers:
age = 15
score = -10
year = 2024
8
Floats
Floats are numbers that have decimal points. They allow you to represent more precise values.
Here are some examples of floats:
temperature = 36.6
price = 19.99
distance = 3.149
Putting It All Together
Let's see how variables and data types work together in a simple program.
Here's an example:
# Storing different types of data
name = "Bob"
age = 12
height = 1.75
# Displaying the information
print("Name:", name)
print("Age:", age)
print("Height:", height, "meters")
10
Check Your Understanding
Let's answer a quick question to see what you've learned!
11
Great Job!
You now understand variables and basic data types in Python. Keep practicing by creating your own variables and experimenting with different data types.

Frequently asked questions
Is the “Variables and Data Types” lesson free?
Yes — the full text of “Variables and Data Types” is free to read here on the web, and the Python For Kids course includes 3 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Python For Kids course, upgrade to CoddyKit PRO.
What will I learn in “Variables and Data Types”?
Understanding variables, strings, integers, and floats You practise Python For Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Python For Kids?
No prior experience is required. Python For Kids on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 3, so you can start here or from the beginning and move at your own pace.
How long does the “Variables and Data Types” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Python For Kids lesson?
Yes. Every Python For Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Variables and Data Types
- Basic Arithmetic Operations
- Input and Output