Python Tutorial

Python Getting Started

Understand Python, run your first program, use the interpreter and learn the basic execution model.

Concept

Python source code is written in plain-text .py files and executed by the Python interpreter. For early practice, an interactive interpreter is useful because each statement can be tried immediately.

Start with a tiny program, then learn how indentation, comments and statements work. Python uses indentation as syntax, so consistent spacing is part of writing correct code.

Example

name = "Mango Learner"
print("Hello,", name)
print(2 + 3)
Type the example yourself and change at least one value. Small experiments reveal syntax and behavior faster than passive reading.

Practice Tasks

  1. Print your name and city.
  2. Store two numbers and print their sum, difference and product.
  3. Add a comment explaining each statement.

Key Takeaways

  • Python code is commonly stored in .py files.
  • Indentation is meaningful.
  • The interpreter is useful for fast experiments.