Quick Review
Quick Review
Explanation
What is Python?
• Python is a high-level, general-purpose programming language, designed to be easy
to read, write, and understand.
• Created by Guido van Rossum in 1991, in the Netherlands.
• Named after the comedy show "Monty Python's Flying Circus" — not the snake!
Python is:
Interpreted → Runs line by line, no need to compile.
Dynamically Typed → You don’t declare data types like int, string manually; Python
figures it out.
High-Level → Easy for humans to understand, close to English.
Open-Source → Free to use, modify, and share.
Object-Oriented → Supports objects, classes, and reuse of code (you'll learn this later).
Variables
• A variable stores information for later use.
• You can store:
o Names
o Numbers
o True/False values
You don't need to declare types — Python figures it out automatically (Dynamic Typing).
Data Types
You learned about different types of information:
You practiced taking inputs like name, age, etc., and printing information.
Decision Making (if-elif-else)
• Used to control the flow of a program.
• Example:
o If a condition is true, do something.
o Else, do something different.
• Helps programs respond to different situations, like:
o Checking age
o Comparing numbers
Loops
Loops repeat tasks, so you don't rewrite code many times:
Used for:
• Counting numbers
• Processing lists
• Creating repetitive actions
Functions
• A function is a reusable block of code.
• It:
o Accepts input (parameters)
o Performs logic
o Optionally returns results
• Helps:
o Avoid repetition
o Make code organized and clean
Lists
• Store multiple values together in one variable.
• Ordered — items have positions (index starts from 0).
• Can change items anytime.
• Allow duplicates.
Example usage:
Tuples
• Like lists but cannot be changed after creation (Immutable).
• Ordered collection.
• Faster and more secure for fixed data.
Example usage:
• Coordinates
• Days of the week
Dictionaries
• Store data as key-value pairs.
• You access items by keys, not positions.
• Keys are unique; values can be anything.
Example usage:
Sets
• Store unique items only.
• Unordered — no guaranteed positions.
• Automatically removes duplicates.
• Useful for mathematical operations:
o Union (combine sets)
o Intersection (common items)
o Difference (items in one set, not the other)
Summary of Python
Simple, beginner-friendly, and powerful
You already know the foundation tools
Widely used for AI, websites, cybersecurity, automation
Supports modern programming styles
One of the most demanded languages globally