[go: up one dir, main page]

0% found this document useful (0 votes)
187 views8 pages

Python 21 Day Detailed Course

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

Python 21 Day Detailed Course

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Python 21-Day Full Beginner Course (Detailed)

Day 1: Introduction, print(), input(), comments


Concepts:

- print(): display output

- input(): take input from user

- Comments: notes in code, ignored by Python

Example:

print("Hello, World!")

name = input("Enter your name: ")

print("Welcome", name)

Assignment:

- Ask name and age from user

- Display welcome message

Day 2: Variables & Data Types


Concepts:

- Variables: used to store data

- Data Types: int, float, str, bool

Example:

name = "Rahul"

age = 21

height = 5.9

is_student = True

print(type(name)) # str

print(type(age)) # int

Assignment:

- Declare and print 4 variables


Day 3: Operators (Arithmetic & Comparison)
Concepts:

- +, -, *, /, %, //, **

- ==, !=, >, <, >=, <=

Example:

a = 10

b=5

print(a + b)

print(a > b)

Assignment:

- Build a basic calculator

Day 4: If-Else Statements


Concepts:

- Condition checking using if, elif, else

Example:

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

if age >= 18:

print("Adult")

else:

print("Minor")

Assignment:

- Check odd/even number

Day 5: Loops (for, while)


Concepts:

- Loop through numbers and lists

Example:

for i in range(1, 6):


print(i)

n=1

while n <= 5:

print(n)

n += 1

Assignment:

- Print multiplication table

Day 6: Strings & Operations


Concepts:

- String slicing, methods, formatting

Example:

name = "Rahul"

print(name.upper())

print(name[0:3])

Assignment:

- Reverse a string entered by user

Day 7: Mini Project: Guess the Number


Project:

- Use random module

- User tries to guess a number

Example:

import random

number = random.randint(1, 10)

guess = int(input("Guess: "))

if guess == number:

print("Correct!")

else:
print("Wrong. It was", number)

Day 8: Functions
Concepts:

- Function definition, parameters, return

Example:

def greet(name):

return "Hello " + name

print(greet("Rahul"))

Assignment:

- Function to return factorial

Day 9: Lists
Concepts:

- Store multiple values, access, modify

Example:

fruits = ["apple", "banana"]

fruits.append("cherry")

print(fruits[1])

Assignment:

- Find max value from a list

Day 10: Tuples & Sets


Concepts:

- Tuple: ordered, immutable

- Set: unordered, no duplicates

Example:

t = (1, 2, 3)

s = {1, 2, 2, 3}
print(s)

Assignment:

- Create set, remove/add elements

Day 11: Dictionaries


Concepts:

- Key-value pairs

Example:

student = {"name": "Rahul", "age": 21}

print(student["name"])

Assignment:

- Add 3 students and their marks

Day 12: Pattern Printing


Concepts:

- Nested loops

Example:

for i in range(1, 6):

print("*" * i)

Assignment:

- Print triangle or number patterns

Day 13: Exception Handling


Concepts:

- try, except

Example:

try:

x=1/0

except ZeroDivisionError:
print("Cannot divide by zero")

Assignment:

- Handle invalid input for division

Day 14: Project: Contact Book


Project:

- Dictionary-based storage

Example:

contacts = {}

contacts["Rahul"] = "9999999999"

Assignment:

- Add, search, and delete contacts

Day 15: File Handling


Concepts:

- Open, read, write files

Example:

with open("data.txt", "w") as f:

f.write("Hello")

Assignment:

- Save user input into file

Day 16: Modules & Libraries


Concepts:

- Using built-in modules

Example:

import math

print(math.sqrt(25))
Assignment:

- Use random and math modules

Day 17: Intro to Pandas


Concepts:

- Load CSV and view data

Example:

import pandas as pd

df = pd.read_csv("data.csv")

print(df.head())

Assignment:

- Load any CSV file and print summary

Day 18: Data Cleaning


Concepts:

- Filtering and dropping nulls

Example:

df.dropna()

df[df["marks"] > 50]

Assignment:

- Clean marks data

Day 19: Matplotlib Charts


Concepts:

- Bar, line, pie charts

Example:

import matplotlib.pyplot as plt

plt.bar(["A", "B"], [10, 20])

plt.show()
Assignment:

- Create bar chart from data

Day 20: Project: Marks Analyzer


Project:

- Analyze CSV student marks

Example:

- Use pandas to calculate average, max

Assignment:

- Show top 3 students from CSV

Day 21: Final Project: Weather App


Project:

- Use API to get weather data

Example:

- Use requests module and JSON parsing

Assignment:

- Display current weather by city input

You might also like