Ram

Lesson 2 of 19

Variables & Data Types

Store text, numbers and boolean values in named variables.

Introduction

A variable gives a value a reusable name. Python determines the basic data type from the value you assign.

Common beginner types include strings, integers, floating-point numbers and booleans.

Key insight

Store text, numbers and boolean values in named variables.

Example

name = "Asha"
age = 24
learning = True
print(name, age, learning)

This example shows the core variables & data types idea in a small, runnable program.

Real-world example

Variables & Data Types appears in everyday application code, scripts and APIs.

Test yourself

2-question check

1

What is the main idea in Variables & Data Types?

2

Where can variables & data types be useful?

Ready to check your understanding?

Answer every question, then submit your quiz.

Try it yourself

Python compiler

Runs in your browser. Nothing is sent to a server.

Output appears here

First run downloads the Python runtime, so it may take a moment.

Practice challenge

Create variables for your city, age and whether you enjoy coding.

Previous
Next