๐Ÿ“‹ LMS Ready โ€“ This course can be exported to H5P, Moodle, Canvas, or any SCORM-compatible LMS.

๐Ÿš€ Introduction to Python

Module 1 of 7
๐Ÿ

What is Python?

Python is a high-level, interpreted, general-purpose programming language known for its simplicity and readability. Created by Guido van Rossum and first released in 1991, Python has become one of the world's most popular languages. Its clean syntax makes it perfect for beginners while remaining powerful enough for experts building complex systems.

Why Learn Python?

๐ŸŒ

Web Development

Build web apps with Django and Flask frameworks.

๐Ÿ“Š

Data Science

Analyze data with Pandas, NumPy, and Matplotlib.

๐Ÿค–

AI / Machine Learning

Build AI models with TensorFlow and PyTorch.

โšก

Automation

Automate boring tasks with scripts and bots.

๐ŸŽฎ

Game Development

Create games with Pygame and Arcade libraries.

๐Ÿ”’

Cybersecurity

Write security tools and automate pen-testing.

How Python Works

๐Ÿ“ Your Code
(.py file)
โ†’
๐Ÿ”„ Python
Interpreter
โ†’
๐Ÿ’ป Machine
Executes
โ†’
๐Ÿ“ค Output
Results

Your First Program

print("Hello, World!") print("Welcome to Python!")
Hello, World! Welcome to Python!

Python Popularity vs Other Languages

๐Ÿ“บ Recommended Video

โ–ถ

Python Tutorial for Beginners

freeCodeCamp ยท Full beginner course on YouTube

Click to watch on YouTube โ†’

๐Ÿ“ Module 1 Quiz

Q1: Who created Python?

A Linus Torvalds
B Guido van Rossum
C James Gosling
D Bill Gates

Q2: What does print() do?

A Saves a file
B Displays output
C Creates a variable
D Imports a module

Q3: Python files end with what extension?

A .java
B .txt
C .py
D .exe

Q4: Python is which type of language?

A Compiled
B Interpreted
C Assembly
D Binary
๐Ÿ“ฆ

What is a Variable?

A variable is like a labeled box that stores a value. You give it a name and put data inside. When you need that data later, you just use the variable's name to retrieve it.

Variable Naming Rules

โœ… Start with a letter or underscore
โœ… No spaces (use_underscores)
โœ… Case-sensitive (age โ‰  Age)
โŒ No reserved words (if, for, etc.)

Creating Variables

name = "Alice" age = 25 height = 5.6 is_student = True print(name, age, height, is_student)
Alice 25 5.6 True

Getting User Input โ€” Try It!

name = input("Enter your name: ") print("Hello,", name + "!")

โ–ถ Interactive Demo

Variable Types Distribution

Variable Naming: Good vs Bad

โœ… Good Names

user_age total_price is_active

โŒ Bad Names

x 123abc my variable

๐Ÿ“บ Recommended Video

โ–ถ

Python Variables

CS Dojo ยท Variables explained clearly

Click to watch on YouTube โ†’

๐Ÿ“ Module 2 Quiz

Q1: Which is a valid variable name?

A 2name
B my name
C _myName
D my-name

Q2: What does input() do?

A Prints text
B Gets user input
C Creates a list
D Runs a loop

Q3: x = 10; what type is x?

A String
B Float
C Integer
D Boolean

Q4: Python is case-sensitive. True or False?

A True
B False
C Sometimes
D Depends

Data Types Overview

๐Ÿ”ข

int

Whole numbers: 42, -7

๐Ÿ”ฃ

float

Decimals: 3.14, -0.5

๐Ÿ“

str

Text: "Hello"

โœ…

bool

True or False

๐Ÿ“‹

list

Ordered: [1, 2, 3]

๐Ÿ“–

dict

Key-value: {"a": 1}

Type Conversion

x = "42" y = int(x) # "42" โ†’ 42 z = float(x) # "42" โ†’ 42.0 t = type(y) # <class 'int'> print(y, z, t)
42 42.0 <class 'int'>

String Operations

text = "Hello, Python!" print(text.upper()) # HELLO, PYTHON! print(text.lower()) # hello, python! print(text.replace("Hello", "Hi")) # Hi, Python! print(len(text)) # 14
HELLO, PYTHON! hello, python! Hi, Python! 14

Data Types Comparison

TypeExampleMutableUse Case
int42NoCounting, indexing
float3.14NoMeasurements, money
str"hello"NoText, names, messages
boolTrueNoConditions, flags
list[1,2,3]YesOrdered collections
dict{"a":1}YesKey-value mappings

Number Line: Integers vs Floats

0int
1int
1.5float
2int
2.7float
3int
3.14float
Integer Float

Most Used Data Types in Python Code

โ–ถ

Python Data Types

Tech With Tim ยท Data types explained

Click to watch on YouTube โ†’

๐Ÿ“ Module 3 Quiz

Q1: What type is 3.14?

A int
B float
C str
D bool

Q2: len('Python') returns?

A 5
B 6
C 7
D Error

Q3: Which converts string to integer?

A str()
B float()
C int()
D bool()

Q4: True and False are what type?

A str
B int
C bool
D float
๐Ÿ—บ๏ธ

Control Flow

Control flow is like a GPS โ€” it decides which road your program takes based on conditions. Using if, elif, and else, you tell Python what to do in different situations.

If / Elif / Else

score = 85 if score >= 90: print("Grade: A") elif score >= 80: print("Grade: B") # โ† runs this elif score >= 70: print("Grade: C") else: print("Grade: F")
Grade: B

Decision Flowchart

Start: score = 85
โ†“
score โ‰ฅ 90?
No โ†“
Yes โ†’
Print "A"
score โ‰ฅ 80?
No โ†“
Yes โ†’
Print "B" โœ“
Else: Print "F"

For Loop

fruits = ["apple", "banana", "cherry"] for fruit in fruits: print("I love", fruit)
I love apple I love banana I love cherry

While Loop

count = 1 while count <= data-id="654" 5: print("Count:", count) count += 1 print("Done!")
Count: 1 Count: 2 Count: 3 Count: 4 Count: 5 Done!

Loop Animation

Watch the loop count from 1 to 5:

1
2
3
4
5

Comparison Operators

OperatorMeaningExampleResult
==Equal to5 == 5True
!=Not equal5 != 3True
>Greater than7 > 3True
<Less than2 < 8True
>=Greater or equal5 >= 5True
<=Less or equal3 <= 1False
โ–ถ

Python If Statements & Loops

Bro Code ยท Control flow explained

Click to watch on YouTube โ†’

๐Ÿ“ Module 4 Quiz

Q1: Which keyword starts a conditional?

A loop
B when
C if
D check

Q2: for i in range(3) runs how many times?

A 2
B 3
C 4
D 1

Q3: == checks for?

A Assignment
B Equality
C Greater than
D Not equal

Q4: while True: creates?

A A variable
B An infinite loop
C A function
D A list
๐Ÿ•

What is a Function?

A function is like a recipe โ€” you write it once and use it many times. Functions help organize code, make it reusable, and keep things DRY (Don't Repeat Yourself).

Defining Functions

def greet(name): message = "Hello, " + name + "!" return message result = greet("Alice") print(result) # Hello, Alice!
Hello, Alice!

Function Anatomy

def greet(name): โ† keyword, name, parameter message = "Hello, " + name โ† function body return message โ† return statement
def

Keyword

greet

Function Name

name

Parameter

return

Output

Parameters vs Arguments

Parameter

The variable in the function definition

def greet(name):

Argument

The actual value passed when calling

greet("Alice")

Built-in Functions Gallery

print()

Display output

input()

Get user input

len()

Get length

range()

Number sequence

type()

Check type

int()

Convert to int

str()

Convert to string

sum()

Add numbers

Lambda Functions

square = lambda x: x ** 2 double = lambda x: x * 2 print(square(5)) # 25 print(double(7)) # 14
25 14

Most Used Python Built-in Functions

โ–ถ

Python Functions

Programming with Mosh ยท Functions deep dive

Click to watch on YouTube โ†’

๐Ÿ“ Module 5 Quiz

Q1: Which keyword defines a function?

A func
B define
C def
D function

Q2: What does return do?

A Prints output
B Ends program
C Sends back a value
D Loops

Q3: lambda creates?

A A class
B An anonymous function
C A loop
D A variable

Q4: Can functions call other functions?

A No
B Yes
C Only once
D Only built-ins

Collections Overview

๐Ÿ“‹

List []

Ordered, mutable, allows duplicates

๐Ÿ“Œ

Tuple ()

Ordered, immutable, allows duplicates

๐Ÿ“–

Dictionary {}

Key-value pairs, mutable

๐ŸŽฏ

Set {}

Unordered, unique items only

Lists

fruits = ["apple", "banana", "cherry"] fruits.append("mango") fruits.remove("banana") print(fruits) # ['apple', 'cherry', 'mango'] print(fruits[0]) # apple
['apple', 'cherry', 'mango'] apple

Dictionaries

student = { "name": "Alice", "age": 20, "grade": "A" } print(student["name"]) # Alice student["age"] = 21 print(student)
Alice {'name': 'Alice', 'age': 21, 'grade': 'A'}

Collections Comparison

FeatureListTupleDictSet
Orderedโœ“โœ“โœ“โœ—
Mutableโœ“โœ—โœ“โœ“
Duplicatesโœ“โœ“โœ— keysโœ—
Syntax[](){k:v}{}

List Memory Model

fruits = ["apple", "cherry", "mango"]

Index 0

"apple"

Index 1

"cherry"

Index 2

"mango"

When to Use Each Collection

โ–ถ

Python Lists, Tuples, Dictionaries

freeCodeCamp ยท Complete collections tutorial

Click to watch on YouTube โ†’

๐Ÿ“ Module 6 Quiz

Q1: How do you add to a list?

A list.add()
B list.append()
C list.push()
D list.insert()

Q2: Tuples are?

A Mutable
B Immutable
C Ordered only
D Key-value pairs

Q3: dict['key'] does what?

A Deletes key
B Adds key
C Accesses value
D Loops

Q4: Sets allow duplicates?

A Yes
B No
C Sometimes
D Only strings
๐ŸŽ‰

You've Learned the Core of Python!

Now let's put it all together with real mini projects. Each project combines variables, data types, control flow, functions, and collections.

๐ŸŽฒ Project 1: Number Guessing Game

import random secret = random.randint(1, 100) # Random number 1-100 attempts = 0 # Counter for guesses while True: # Loop until correct guess = int(input("Guess (1-100): ")) attempts += 1 if guess < secret: print("Too low! Try higher.") elif guess > secret: print("Too high! Try lower.") else: print(f"Correct! You got it in {attempts} attempts!") break # Exit the loop
Guess (1-100): 50 Too low! Try higher. Guess (1-100): 75 Too high! Try lower. Guess (1-100): 63 Correct! You got it in 3 attempts!

๐Ÿงฎ Project 2: Simple Calculator

def calculate(a, op, b): if op == "+": return a + b elif op == "-": return a - b elif op == "*": return a * b elif op == "/": return a / b if b != 0 else "Error" num1 = float(input("First number: ")) op = input("Operator (+, -, *, /): ") num2 = float(input("Second number: ")) print("Result:", calculate(num1, op, num2))
First number: 15 Operator: * Second number: 4 Result: 60.0

๐Ÿ“Š Project 3: Student Grade Tracker

students = {} # Empty dictionary def add_student(name, grades): students[name] = grades avg = sum(grades) / len(grades) students[name + "_avg"] = avg add_student("Alice", [92, 87, 95, 88]) add_student("Bob", [78, 82, 80, 85]) for name, grades in students.items(): if "_avg" not in name: print(f"{name}: Avg = {students[name+'_avg']:.1f}")
Alice: Avg = 90.5 Bob: Avg = 81.3

Skills Covered in This Course

๐Ÿš€ What's Next?

๐Ÿ›๏ธ

Object-Oriented Programming

Classes, objects, inheritance

๐Ÿ“

File I/O

Read and write files

๐ŸŒ

Web Dev with Flask

Build web applications

๐Ÿผ

Data Science with Pandas

Analyze datasets

๐Ÿ”Œ

APIs & Web Scraping

Connect to web services

โ–ถ

Python Full Beginner Project Tutorial

freeCodeCamp ยท Build real projects

Click to watch on YouTube โ†’

๐Ÿ“ Final Quiz โ€” All Modules Combined

Q1: random.randint(1,10) returns?

A Always 5
B A random int 1-10
C A float
D A string

Q2: f-strings use?

A % formatting
B .format()
C f"..." prefix
D print only

Q3: break does what in a loop?

A Pauses
B Restarts
C Exits the loop
D Skips one iteration

Q4: import random imports?

A A function
B A module
C A class
D A variable

Q5: Which concept combines all others?

A Variables
B Functions
C A project
D Loops

๐ŸŽ‰ You've reached the end of the course! Complete all quizzes to earn your certificate.

๐Ÿ

Certificate of Completion

Python for Absolute Beginners

This certifies that

Mike

has successfully completed all 7 modules of the
Python for Absolute Beginners interactive course.

July 10, 2026