10-Day Python Learning Notes
Day 1: Introduction & Basics
- Python is a beginner-friendly language.
- Learn print(), variables, data types (int, float, str, bool), and comments.
Example:
name = 'Uvaraj'
print('Hello', name)
Day 2: Input & Operators
- Use input() to get user input.
- Learn arithmetic (+, -, *, /, %, //, **), logical, and comparison operators.
- Convert types using int(), float(), str().
Example:
a = int(input('Enter a number: '))
print(a + 5)
Day 3: Conditionals
- Use if, elif, else for decisions.
- Use ==, >, <, != to compare.
Example:
if score > 90:
print('Grade A')
Day 4: Loops
- for loop with range(), while loop for unknown iterations.
- Use break, continue to control flow.
Example:
for i in range(1, 6):
print(i)
Day 5: Functions
- Define functions with def.
- Return values with return.
Example:
10-Day Python Learning Notes
def add(x, y):
return x + y
print(add(2, 3))
Day 6: Lists & Tuples
- Lists: ordered, changeable. Tuples: ordered, unchangeable.
- List methods: append(), pop(), sort(), len().
Example:
fruits = ['apple', 'mango']
fruits.append('banana')
Day 7: Dictionaries & Sets
- Dictionary: key-value pairs.
- Set: unordered unique values.
Example:
student = {'name': 'Uvaraj', 'age': 20}
print(student['name'])
Day 8: Strings & Files
- Use string methods: upper(), lower(), replace(), split().
- File handling: open(), read(), write(), close().
Example:
f = open('file.txt', 'w')
f.write('Hello')
f.close()
Day 9: OOP Basics
- Create classes with class keyword.
- Use __init__ for constructors.
Example:
class Person:
def __init__(self, name):
self.name = name
10-Day Python Learning Notes
Day 10: Revision & Mini Project
- Revise all topics.
- Try building: Quiz app, BMI calculator, To-do list, Student marks system.
Tip: Focus on applying all concepts into one project.