Python Introduction

Select a topic below to begin exploring Python basics with interactive examples.

Scroll or tap a topic to jump to its card.

Introduction to Python

Python Getting Started

Getting Started

Welcome to the Python Development

Python is not just a language, it’s a superpower. In this course, you’ll go from writing your first line of code to building cool projects that’ll make you say, “Wow, I did that! 😎”

Whether you’re totally new to coding or just looking to sharpen your Python skills, get ready for an epic journey filled with coding magic, challenges, and lots of fun moments.

Python Language Quick Overview

Python is a high-level, interpreted programming language used for many different purposes, from web development to scientific computing to machine learning.

Why Python is a great choice:

Install Python 3 and VS Code on Windows

Install Python

  1. Download the latest Python from python.org.
  2. Run the installer and follow the steps.
  3. Important: Check “Add Python to environment variables” during installation so you can run Python from anywhere.
  4. (Optional) Choose a custom installation path if you prefer.

Note: Many Unix-based systems (Linux, macOS) come with Python preinstalled.

Tip: You can also run Python right in the browser below using the live editors — no install needed.

Try it: Check Python basics


		
Understanding Python Datatypes

Understanding Python Datatypes

In programming, data types describe the kind of data a variable can hold. Example:

num = 24  # 24 is an int so num is of class int

Since everything is an object in Python, data types are actually classes, and variables are instances of these classes.

Python Core Data Type Categories

CategoryClassesDescription
Numericint, float, complexHolds numeric values
StringstrSequence of characters
Sequencelist, tuple, rangeOrdered collection of items
MappingdictKey–value pairs
BooleanboolTrue or False
SetsetUnique unordered items
Variables in Python

Variables in Python

In programming, a variable is a container (storage area) used to hold data.

number = 10

Assigning values to variables

Use the assignment operator = to assign a value to a variable.

site_name = "Power Learn Project"

Numeric Types

Python numbers: int (arbitrary length), float (double precision ~15 decimal places), and complex (rarely used early on).

Note: Python is a type‑inferred language. You don’t have to explicitly declare the type; Python infers that "Power Learn Project" is a str, so site_name is a string.

Changing the value of a variable

site_name = "Power Learn Project"

Try it: Numeric and type()

Assigning multiple values

a, b, c = 5, 7, "Hello world"

		

Rules for naming Python variables

  • Use letters (a–z, A–Z), digits (0–9), and underscore _. Don’t start with a digit.
  • Python is case‑sensitive: num and Num are different.
  • Avoid using Python keywords like if, True, class, etc.
  • Common styles: snake_case, MACRO_CASE, camelCase, CapsWords.
num = 55

List (Mutable Ordered Sequence)

Lists hold ordered items and can mix types. Defined with [ ].

Try it: Variables quick demo


						

More Resources

Try it: List basics


		
		

Tuple (Immutable Ordered Sequence)

Tuples use ( ) and once created cannot be modified.

Try it: Tuple basics


		

String

Strings are sequences of characters in quotes. They support indexing and slicing.

Try it: String basics


		

Set (Unique Unordered Collection)

Sets use { } and automatically remove duplicates. They don’t support indexing.

Try it: Set basics


		

Dictionary (Ordered Key–Value Store)

Dictionaries map keys to values. Keys must be unique.

Try it: Dictionary basics


		

More Resources