Python
Python
o VS Code (recommended)
o PyCharm
python
CopyEdit
print("Hello, World!")
Concept Example
Variables x = 10
Integer x=5
Float pi = 3.14
1. If...Else
python
CopyEdit
print("Adult")
else:
print("Minor")
2. For Loop
python
CopyEdit
for i in range(5):
print(i)
3. While Loop
python
CopyEdit
x += 1
🔹 Step 7: Functions
python
CopyEdit
def greet(name):
python
CopyEdit
try:
result = 10 / 0
except ZeroDivisionError:
finally:
print("Done")
CopyEdit
class Car:
self.brand = brand
def drive(self):
print(f"{self.brand} is moving")
my_car = Car("Toyota")
my_car.drive()
o Class
o Object
o Inheritance
o Polymorphism
o Encapsulation
python
CopyEdit
# file: mymodule.py
return x + y
python
CopyEdit
import mymodule
print(mymodule.add(2, 3))
python
CopyEdit
data = f.read()
bash
CopyEdit
# Activate (Windows)
venv\Scripts\activate
# Install packages
Type hinting:
python
CopyEdit
return x + y
3. Build projects:
o Calculator
o Todo App
o Weather API
o OOP
o File handling
o API consumption
5. Explore domains: