P

Python Basics

Write your first Python code — learn variables, data types, conditionals, and loops interactively.

Programming v1.0.0 24 uses
Step 1 of 4

Step 1: Variables & Types

In Python, you don't need to declare types — just assign values:

name = "Alice"    # String
age = 25          # Integer
pi = 3.14         # Float
active = True     # Boolean

Try the code below — modify the values and run it:

About This Lab

Python is one of the most popular programming languages in the world, known for its clean syntax and versatility. In this lab, you'll learn the fundamentals: variables, basic data types, if/else conditionals, and loops. Each step includes a code editor where you can write and run Python-like code to see instant results.

How It Works

  1. 1 Read the explanation for each Python concept
  2. 2 Write or modify code in the editor
  3. 3 Click 'Run Code' to execute and see output
  4. 4 Experiment freely with the examples
  5. 5 Complete the quiz to test your knowledge

Translate

ESC