5 Days · 2 Hours / Day · Full Notes

5-Day Python Fundamentals — Full Notes

Complete day-by-day study notes for Python Fundamentals — from setup and basics to functions and building your first real program in just 5 days.

Certificate IncludedTheory + Practical DailyOnline & Offline

Before You Start: Python Setup Guide

Follow these steps to get Python installed and ready

1System Requirements

Windows

7 or later, 64-bit

macOS

10.14 or later, Intel/Apple Silicon

Linux

Any modern distribution

2Download Python 3.10+

Visit: python.org/downloads

✓ Click the big yellow "Download Python" button

✓ Choose version 3.11 or 3.12 (latest recommended)

✓ Your OS will be auto-detected

3Installation Instructions

🪟 Windows

  1. 1. Double-click the downloaded .exe file
  2. 2. ⚠️ IMPORTANT: Check the box: "Add Python to PATH"
  3. 3. Click "Install Now"
  4. 4. Wait for completion, then click "Close"

🍎 macOS

  1. 1. Double-click the downloaded .pkg file
  2. 2. Follow the installer wizard
  3. 3. Enter your password when prompted
  4. 4. Click "Close" when done

🐧 Linux (Ubuntu/Debian)

sudo apt update

sudo apt install python3 python3-pip

4Verify Installation

Open Terminal/Command Prompt and run:

python --version

Expected output: Python 3.10.0 (or higher)

Ready? Write Your First Program!

print("Hello, Python!")

Save this as hello.py, then run:
python hello.py

1

Day 1

Python Setup & Basics

Get Python running on your computer and write your first program.

Theory — Hour 1

What is Python?

  • Python is a simple, readable programming language used by beginners and professionals worldwide.
  • Created by Guido van Rossum in 1991. Easy to learn, powerful enough for production apps.
  • Used by companies like Google, Netflix, Spotify, and NASA.

Why Learn Python?

  • Clean, beginner-friendly syntax — focus on logic, not complexity.
  • Huge libraries for AI, data science, web development, and automation.
  • One of the most in-demand programming languages in 2024.

Installation & Environment

  • Download Python from python.org (3.10+ recommended).
  • Verify installation: open terminal/cmd and type 'python --version'.
  • Use a code editor: VS Code, PyCharm Community, or Thonny for beginners.

Your First Program

  • print() function outputs text to the screen.
  • Comments start with # — explain your code.
  • Indentation matters in Python — it defines blocks of code.

Your first Python program

# This is my first Python program
print('Hello, World!')
print('Welcome to Python!')

name = 'Sudhar'
print('Hi, ' + name)

Practical — Hour 2

  • Install Python and verify it works by running 'python --version' in terminal.
  • Write a program that prints your name, age, and city on separate lines.
  • Use comments to explain what each line does.

Key Takeaways

  • Python is simple, readable, and powerful — perfect for beginners.
  • Always verify your installation works before starting projects.
  • Use comments to explain your code; future-you will thank present-you.
2

Day 2

Variables, Data Types & Operations

Learn to store data and perform calculations in Python.

Theory — Hour 1

Variables — Storing Data

  • A variable is a container that holds a value: name = 'Alice'.
  • Variable names are case-sensitive and should be lowercase with underscores (age_of_student).
  • You don't declare a type; Python figures it out automatically.

Basic Data Types

  • int: whole numbers (5, -10, 1000). float: decimals (3.14, -2.5, 0.0).
  • str: text ('hello', 'Python'). bool: True or False.
  • Use type() function to check a variable's type: type(age) → <class 'int'>.

Operations & Arithmetic

  • + (add), - (subtract), * (multiply), / (divide), ** (power), % (remainder).
  • String concatenation: 'Hello ' + 'World' = 'Hello World'.
  • Comparison: == (equal), != (not equal), > (greater), < (less).

Input & Output

  • input() reads user input from the terminal as a string.
  • To convert: int(input()), float(input()) to get numbers.
  • f-strings for clean output: f'My name is {name}, age {age}'.

Variables, types, and operations

name = 'Priya'
age = 20
gpa = 3.8
is_student = True

# Arithmetic
next_year_age = age + 1
print(f'{name} will be {next_year_age} next year')

# Get user input
subject = input('What is your favorite subject? ')
print(f'You like {subject}!')

Practical — Hour 2

  • Create variables for your name, age, city, and marks. Print them using f-strings.
  • Write a program that takes user's name and age, then prints how old they'll be in 5 years.
  • Perform calculations: take 3 numbers from user, find their average.

Key Takeaways

  • Variables store data; types include int, float, str, and bool.
  • Use f-strings for clean, readable output: f'Value is {variable}'.
  • Always convert input() results to the right type (int, float) before using them in math.
3

Day 3

Lists, Tuples & Dictionaries

Organize multiple values using Python's collection data structures.

Theory — Hour 1

Lists — Ordered, Changeable Collections

  • A list stores multiple values: marks = [85, 90, 78, 92].
  • Access elements by index (starting from 0): marks[0] = 85, marks[-1] = 92 (last).
  • Modify lists: marks.append(88), marks.remove(78), marks[0] = 87.

List Operations

  • len(marks) → 4 (number of elements).
  • sum(marks) → 345, max(marks) → 92, min(marks) → 78.
  • Loop through: for mark in marks: print(mark).

Tuples — Immutable Lists

  • Tuples are like lists but cannot be changed: point = (10, 20).
  • Use () instead of []. Useful when data should not be modified.
  • Access same way as lists: point[0] = 10.

Dictionaries — Key-Value Pairs

  • Store related data with labels: student = {'name': 'Alice', 'age': 20, 'dept': 'CSE'}.
  • Access by key: student['name'] = 'Alice'.
  • Add/modify: student['cgpa'] = 3.8, student['name'] = 'Alicia'.

Lists, tuples, and dictionaries in action

# List
marks = [85, 90, 78]
marks.append(92)
print('Average:', sum(marks) / len(marks))

# Tuple
colors = ('red', 'green', 'blue')
print(colors[0])

# Dictionary
student = {'name': 'Priya', 'age': 20, 'dept': 'ECE'}
print(f"{student['name']} is {student['age']} years old")

Practical — Hour 2

  • Create a list of 5 fruits. Add a fruit, remove one, print the average length of names.
  • Create a dictionary for yourself with keys: name, age, city, hobby. Print each value.
  • Write a program that takes 5 numbers from user, stores in list, prints max and min.

Key Takeaways

  • Lists are mutable (changeable); tuples are not. Use lists for most collections.
  • Dictionaries organize data with meaningful labels (keys).
  • Index from 0; use -1 for last element. Index out of range = error.
4

Day 4

Control Flow — If, Else & Loops

Make decisions and repeat actions with conditional statements and loops.

Theory — Hour 1

If, Else, Elif Statements

  • if condition: execute code if condition is True.
  • else: execute if condition is False.
  • elif: check multiple conditions. Only one block executes.

Comparison & Logical Operators

  • ==, !=, >, <, >=, <= for comparisons. Returns True or False.
  • and (both True), or (at least one True), not (opposite).
  • Example: if age >= 18 and is_student: → checks both conditions.

For Loops

  • Loop through a range: for i in range(5): prints 0, 1, 2, 3, 4.
  • Loop through a list: for fruit in fruits: print(fruit).
  • Use enumerate() for index and value: for i, fruit in enumerate(fruits).

While Loops

  • Repeat while a condition is True: while count < 10.
  • break: exit the loop. continue: skip to next iteration.
  • Be careful of infinite loops (condition never becomes False).

Conditionals and loops

# If-Else
marks = 85
if marks >= 80:
    print('Grade: A')
elif marks >= 70:
    print('Grade: B')
else:
    print('Grade: C')

# For loop
for i in range(1, 6):
    print(f'{i} × 2 = {i*2}')

# While loop
count = 0
while count < 3:
    print(f'Count: {count}')
    count += 1

Practical — Hour 2

  • Write a program that takes marks and prints the grade (A: 80+, B: 70-79, C: below 70).
  • Print the multiplication table for a number using a for loop.
  • Write a program that counts from 1 to 10 and prints only even numbers.

Key Takeaways

  • if/elif/else allows decision-making based on conditions.
  • for loops are best for a known number of iterations; while for unknown counts.
  • Remember: for 1-10, use range(1, 11) (end is exclusive).
5

Day 5

Functions & Best Practices

Write reusable code with functions and learn professional Python habits.

Theory — Hour 1

What Are Functions?

  • A function is reusable code that does one task: def greet(name): return 'Hi ' + name.
  • Parameters: inputs to the function. Return: the output.
  • Call a function: greet('Alice') → returns 'Hi Alice'.

Function Basics

  • Parameters can have default values: def greet(name='Guest'): ...
  • Return multiple values: return x, y (creates a tuple).
  • Variable scope: variables inside functions are local (only exist inside).

Modules & Libraries

  • import math to use built-in functions: math.sqrt(16) = 4.0.
  • import random: random.randint(1, 10) picks a random number.
  • from datetime import datetime for date/time operations.

Best Practices

  • Write clear function names: calculate_average() not calc() or ca().
  • Use comments for complex logic, but write self-explanatory code.
  • Keep functions small and focused (do one thing well).
  • Test your code regularly — don't wait until the end.

Functions and modules

import math

def calculate_average(numbers):
    """Calculate average of a list of numbers."""
    return sum(numbers) / len(numbers)

def check_pass(marks):
    if marks >= 40:
        return 'Pass'
    else:
        return 'Fail'

marks_list = [85, 90, 78]
avg = calculate_average(marks_list)
print(f'Average: {avg:.2f}')
print(f'Result: {check_pass(avg)}')

Practical — Hour 2

  • Write a function that takes 3 numbers and returns their average.
  • Write a function that checks if a number is even or odd.
  • Create a simple calculator: function that takes two numbers and an operator (+, -, *, /), returns result.
  • Write a program that uses the math module to calculate: square root, power, and factorial.

Key Takeaways

  • Functions make code reusable and organized. Give them clear, descriptive names.
  • Use docstrings ("""...""") to explain what a function does.
  • Import modules to add powerful built-in functionality to your code.
  • You now have the fundamentals! Practice by building small projects.

What You Will Get

Everything included in the 5-day Python internship

Internship Certificate

Industry-recognised certificate on completion.

Hands-On Projects

Build real Python programs from day 1.

Complete Code Examples

Every concept with working code snippets.

Professional Practices

Learn coding standards used in real jobs.

Why This Course?

Beginner-Friendly

No coding experience needed. Start from zero and build real programs by day 5.

Intensive & Practical

2 hours daily: 1 hour theory, 1 hour hands-on coding. Learning by doing.

Job-Ready Skills

Learn the exact Python that companies use in real projects.

Certification

Earn a recognized internship certificate to add to your resume.

Ready to Start Your Python Journey?

Join the 5-day Python Fundamentals internship — online or offline — with a certificate on completion. Perfect for students, career switchers, and anyone wanting to learn Python.

Follow Us

@qdcodex on Instagram

Web, SEO, IoT & campus projects — see what we're building, day to day.