001. Introduction to Python and Programming
Module 1 · Foundations
Lesson 1 of 200
~45 min
Introduction to Python & Programming
Start with the big picture: what programming is, why Python matters, how Python code becomes instructions a computer can execute, and where professional developers use Python today.
Lesson Video
What you’ll learn
What is programming?
Programming is the process of describing a solution to a problem as a precise sequence of instructions that a computer can execute. A program receives input, performs operations, makes decisions, stores or transforms information, and produces output.
Receive data
Work with data
Apply logic
Show result
This input → process → output pattern appears everywhere—from a calculator to a banking application, recommendation system, game, website, or AI assistant.
Why Python?
Python emphasizes readable syntax and has a broad ecosystem. It is used for automation, back-end systems, APIs, testing, data science, machine learning and AI. Its syntax lets beginners focus on problem solving while still supporting professional software engineering.
Files, reports, repetitive office tasks and workflows.
Backend services, web applications and integrations.
Data analysis, ML, deep learning and LLM applications.
Your first Python program
Python
Step-by-step explanation
print()
A built-in Python function used to display information. Text values are placed inside quotation marks.
name and goal are labels that refer to values. You will study variables deeply in Lesson 5.
Python normally executes statements from top to bottom. Each line can use values created by earlier lines.
Values and data types
Python works with different kinds of values. The four essential beginner types are str for text, int for whole numbers, float for decimal numbers, and bool for True/False values.
| Example | Type | Meaning |
|---|---|---|
"Madhu" |
str |
Text |
25 |
int |
Whole number |
25.5 |
float |
Decimal number |
True |
bool |
Boolean value |
print(type("Madhu"))
print(type(25))
print(type(25.5))
print(type(True))
Variables and assignment
A variable is a meaningful name that refers to a value. In Python, the = symbol is the assignment operator: it assigns the value on the right to the name on the left.
name = "Madhu"
age = 33
score = 10
score = score + 5
print(score)
Good naming
user_age, total_amount, and song_count communicate intent. A name cannot begin with a digit, so 2name is invalid.
Basic mathematics
Python supports arithmetic directly. The main operators are +, -, *, /, //, %, and **.
a = 20
b = 10
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(10 // 3)
print(10 % 3)
print(2 ** 3)
Floor division
Remainder
Power
Strings, input and type conversion
Text values are strings. Modern Python commonly uses f-strings to combine text and values cleanly.
name = "Madhu"
age = 33
print(f"My name is {name} and I am {age} years old.")
input() always returns text. Convert it when you need numeric calculations:
age = int(input("Enter age: "))
next_age = age + 1
print(next_age)
int(), float(), str(), and bool().Build a personal profile program
Combine input, variables, type conversion, calculation and formatted output into one small program.
name = input("Enter your name: ")
age = int(input("Enter your age: "))
city = input("Enter your city: ")
next_year_age = age + 1
print()
print("----- PROFILE -----")
print(f"Name: {name}")
print(f"Age: {age}")
print(f"City: {city}")
print(f"Next year you will be {next_year_age}")
This one program already uses strings, integers, variables, input, conversion, calculation, output and f-strings.
Understanding errors
Errors are a normal part of programming. Python usually tells you what failed and where. For example, using a variable that has never been defined can raise a NameError. Learning to read error messages is an essential programming skill.
Hands-on practice
Create a program that stores your name, city and learning goal in variables and prints a short introduction.
- Create three variables:
name,city, andgoal. - Print each value clearly.
- Add one final line that combines the values into a sentence.
Knowledge check
print() do?
Think about what happened in the first program.
002. Installing Python & Setting Up the Environment →
