0% found this document useful (0 votes)
12 views11 pages

Python Course

Python Course outline

Uploaded by

Younus Bashir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views11 pages

Python Course

Python Course outline

Uploaded by

Younus Bashir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

🗂️Course Outline

📍 Week 1: Introduction to Python & Setup

 Why Python? Real-world use cases


 Installing Python & IDEs (Jupyter, VS Code, PyCharm)
 Writing first script: print("Hello, Python!")
 Variables, data types, and basic I/O
 Comments and code readability

📍 Week 2: Control Flow

 Conditional statements: if, elif, else


 Comparison & logical operators
 Nested conditions
 Real-life examples (e.g., grade calculator)

📍 Week 3: Loops & Iteration

 for and while loops


 break, continue, and pass
 Looping through strings, lists, dicts
 Mini project: Number guessing game 🎮

📍 Week 4: Data Structures – Lists & Tuples

 Lists: creating, indexing, slicing, updating


 List methods (append, remove, sort, etc.)
 Tuples: when and why to use
 Unpacking and swapping

📍 Week 5: Data Structures – Dictionaries & Sets

 Key-value pairs, dictionary methods


 Iterating through dicts
 Sets: uniqueness and operations (union, intersection)
 Use case: Frequency counter or word cloud builder

📍 Week 6: Functions & Modules

 Defining and calling functions


 Parameters, return values
 Default & keyword arguments
 importing standard modules
 Creating custom modules

📍 Week 7: Error Handling & File I/O

 try, except, finally, raise


 File handling: open, read, write, append
 Working with .txt and .csv
 Case Study: Mini log analyzer

📍 Week 8: Object-Oriented Programming (OOP) – Part 1

 Classes and objects


 Constructors and instance variables
 Methods and attributes
 __init__() and self

📍 Week 9: OOP – Part 2

 Inheritance, polymorphism
 Method overriding
 Encapsulation and private attributes
 Real-life modeling: Employee & Manager classes

📍 Week 10: Python Libraries for Data Handling

 math, datetime, random, os


 Intro to NumPy: arrays, vectorization
 Mini Lab: Random password generator or date calculator

📍 Week 11: Working with Pandas

 Series & DataFrames


 Reading/writing CSV, Excel
 Data cleaning: handling nulls, duplicates
 Data summarization (groupby, describe, etc.)
 Visualization intro with matplotlib or seaborn

📍 Week 12: Project Week – Real-World Application

 Students pick from:


o Budget tracker 💰
o Contact manager 📇
o Mini data analysis project 📊
o Quiz or game 🧠

Week 13: APIs & Web Requests

 Using requests, JSON


 Call a public API (e.g., weather or cryptocurrency)
 Create a simple data-fetcher project

Week 14: Automation & Scripting

 Automate boring stuff (e.g., renaming files, sending emails)


 schedule, time, and os libraries
 Final showcase projects + feedback
🗓️Week 1: Introduction to Python & Setup
🎯 Learning Objectives

By the end of this week, students should be able to:

 Understand what Python is and where it's used.


 Install Python and set up a development environment.
 Write and run a basic Python script.
 Use variables and understand basic data types.
 Take input and display output.
 Write readable code with comments.

🧩 1. Why Python? Real-world Use Cases

Slide Topics:

 What is Python? (High-level, interpreted, open-source)


 Python’s design philosophy: Simple, readable, elegant
 Companies using Python: Google, Netflix, NASA, Instagram, Dropbox
 Industries using Python:
o Data Science & AI 🤖
o Web Development 🌐
o Automation 🛠️
o Cybersecurity 🔐
o Finance & FinTech 💸
o Gaming 🎮

Activity:

Discuss in pairs: "Where do you think Python could be used in your career or field of study?"

⚙️2. Installing Python & IDEs

Slide Topics:

 Python installation from python.org


 Setting environment variables (optional)
 IDE options:
o Jupyter Notebook: Best for data science
o VS Code: Lightweight and customizable
o PyCharm: Full-featured IDE for projects

Lab Activity:

 Guide students to:


o Install Python
o Install VS Code or Jupyter (via Anaconda or pip)
o Run their first .py file
o Try out the Python interactive shell (python or python3 in terminal)

🐍 3. Writing Your First Script


python

print("Hello, Python!")

Slide Topics:

 print() function
 How Python executes scripts line-by-line
 Saving and running .py files

Exercise:

Ask students to personalize their first script:


print("Hello, I am Younus and I love Python!")

📦 4. Variables, Data Types & Basic I/O

Key Concepts:

 Variables: Naming rules, dynamic typing

python

name = "Ali"
age = 22

 Data Types: int, float, str, bool


 Type conversion: int(), float(), str()
 Input/Output:
python

name = input("Enter your name: ")


print("Hello", name)

Lab Activity:

Mini challenge: Ask name and age, then print:


"Hello Ali! You are 22 years old."

💬 5. Comments & Code Readability

Topics:

 Why write comments?


 Single-line comments: #
 Multi-line comments: ''' ''' or """ """
 Naming conventions (PEP8): snake_case, meaningful names
 Indentation: 4 spaces (not tabs!)
 White space and line breaks

Example:

python

# This is a comment
''' This is a
multi-line comment '''
🗓️Week 2: Control Flow in Python
🎯 Learning Objectives

By the end of this lesson, students will be able to:

 Understand how decision-making works in programming.


 Use if, elif, and else statements.
 Apply comparison and logical operators in conditions.
 Write nested conditions.
 Create small decision-based programs.

🧠 Lesson Structure (60 Minutes)

Part 1: Warm-Up Discussion (5 Minutes)

Prompt:
Ask students:

"Can you think of a situation where you make a decision based on a condition? Like 'If I’m
hungry, I’ll eat.' How do we tell the computer to do this?"

Write a few real-life decision examples on the board and explain how they can be converted into
Python code.

Part 2: Conditional Statements (15 Minutes)

🔹 1. if Statement
python

temperature = 25
if temperature > 20:
print("It's warm outside!")
🔹 2. else Statement
python

temperature = 15
if temperature > 20:
print("It's warm")
else:
print("It's cold")
🔹 3. elif (Else If)
python

temp = 20
if temp > 30:
print("It's hot")
elif temp > 20:
print("It's warm")
else:
print("It's cold")

✅ Explain:

 How Python checks conditions top-to-bottom.


 Only the first True block runs.

Part 3: Comparison Operators (10 Minutes)

Operator Meaning Example (x = 5, y = 10)

== Equal to x == y → False

!= Not equal to x != y → True

> Greater than x > y → False

< Less than x < y → True

>= Greater or equal x >= 5 → True

<= Less than or equal x <= 5 → True

✅ Mini Practice:
Ask students:

python

x = 10
y = 20
# What will be the result of these?
print(x == y)
print(x < y)

Part 4: Logical Operators (10 Minutes)


Operator Meaning Example

and True if both conditions are true x > 5 and x < 15

or True if at least one is true x < 5 or x < 20

not Inverts the condition not(x > 10)

🔹 Example:
python

age = 25
if age >= 18 and age <= 60:
print("You can apply for the job.")

Part 5: Nested Conditions (10 Minutes)

🔹 Example:
python

age = int(input("Enter your age: "))


if age >= 18:
gender = input("Enter gender (M/F): ")
if gender == "F":
print("Eligible for women’s program.")
else:
print("Eligible for men’s program.")
else:
print("Not eligible.")

✅ Concepts Covered:

 Using if inside another if.


 Logical flow clarity.

Part 6: Practice Tasks (Hands-On Activity – 10 Minutes)

Give students 2 tasks to complete during class.

📝 Task 1: Grade Calculator


python

# Input: marks
# Output: Grade A/B/C/F

marks = int(input("Enter your marks: "))


# Write logic to print grade based on marks
Grading Logic (can be shown on screen):

 A: 80–100
 B: 70–79
 C: 60–69
 F: < 60

📝 Task 2: Number Checker


python

# Check if a number is positive, negative, or zero.


num = int(input("Enter a number: "))

You might also like