Class 11 Python – Complete Guide (Fundamentals
to Dictionaries)
1. Introduction to Python
Python is a high-level, interpreted, and easy-to-learn programming language.
Example:
print("Hello, World!")
2. Variables and Data Types
x = 10 # int
y = 3.14 # float
name = "Rishi" # string
is_student = True # boolean
3. Operators
a = 10
b = 3
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a % b)
print(a ** b)
4. Input and Output
name = input("Enter your name: ")
age = int(input("Enter your age: "))
print("Name:", name)
print("Age:", age)
5. Conditional Statements
x = int(input("Enter a number: "))
if x > 0:
print("Positive")
elif x < 0:
print("Negative")
else:
print("Zero")
6. Loops
# for loop
for i in range(1, 6):
print(i)
# while loop
i = 1
while i <= 5:
print(i)
i += 1
7. Strings
s = "Python"
print(s[0])
print([Link]())
print([Link]())
print(s[0:4])
8. Lists
marks = [90, 85, 78, 92]
[Link](88)
[Link](78)
print(marks)
print(len(marks))
9. Tuples
t = (10, 20, 30)
print(t[1])
# tuples are immutable
10. Dictionaries
student = {
"name": "Rishi",
"class": 11,
"marks": 92
}
print(student["name"])
student["marks"] = 95
student["school"] = "ABC School"
print(student)