•
•
•
•
# Example: Variables and Operators
a = 10
b = 5
sum = a + b
print("Sum =", sum)
1
2
3
4
1
2
3
•
•
•
•
# Example: If condition
num = int(input("Enter number: "))
if num % 2 == 0:
print("Even Number")
else:
print("Odd Number")
1
2
3
1
2
3
•
•
•
•
# Example: String slicing
text = "Python"
print(text[0:3])
1
2
3
1
2
3
•
•
•
•
# Example: List operations
numbers = [5,2,9,1]
[Link]()
print(numbers)
1
2
3
1
2
3
•
•
•
•
# Example: Exception handling
try:
a = 10
b = 0
print(a/b)
except ZeroDivisionError:
print("Cannot divide by zero")
finally:
print("Program finished")
1
2
3
1
2
3
# Example: Variables and Operators
a = 10
b = 5
sum = a + b
print("Sum =", sum)
1
2
3
# Example: If condition
num = int(input("Enter number: "))
if num % 2 == 0:
print("Even Number")
else:
print("Odd Number")
1
2
3
# Example: String slicing
text = "Python"
print(text[0:3])
1
2
3
# Example: List operations
numbers = [5,2,9,1]
[Link]()
print(numbers)
1
2
3
# Example: Exception handling
try:
a = 10
b = 0
print(a/b)
except ZeroDivisionError:
print("Cannot divide by zero")
finally:
print("Program finished")
1
2
3
# Example: Variables and Operators
a = 10
b = 5
sum = a + b
print("Sum =", sum)
1
2
3
# Example: If condition
num = int(input("Enter number: "))
if num % 2 == 0:
print("Even Number")
else:
print("Odd Number")
1
2
3
# Example: String slicing
text = "Python"
print(text[0:3])
1
2
3
# Example: List operations
numbers = [5,2,9,1]
[Link]()
print(numbers)
1
2
3
# Example: Exception handling
try:
a = 10
b = 0
print(a/b)
except ZeroDivisionError:
print("Cannot divide by zero")
finally:
print("Program finished")
1
2
3
# Example: Variables and Operators
a = 10
b = 5
sum = a + b
print("Sum =", sum)
1
2
3
# Example: If condition
num = int(input("Enter number: "))
if num % 2 == 0:
print("Even Number")
else:
print("Odd Number")
1
2
3
# Example: String slicing
text = "Python"
print(text[0:3])
1
2
3
# Example: List operations
numbers = [5,2,9,1]
[Link]()
print(numbers)
1
2
3
# Example: Exception handling
try:
a = 10
b = 0
print(a/b)
except ZeroDivisionError:
print("Cannot divide by zero")
finally:
print("Program finished")
1
2
3
# Example: Variables and Operators
a = 10
b = 5
sum = a + b
print("Sum =", sum)
1
2
3
# Example: If condition
num = int(input("Enter number: "))
if num % 2 == 0:
print("Even Number")
else:
print("Odd Number")
1
2
3
# Example: String slicing
text = "Python"
print(text[0:3])
1
2
3
# Example: List operations
numbers = [5,2,9,1]
[Link]()
print(numbers)
1
2
3
# Example: Exception handling
try:
a = 10
b = 0
print(a/b)
except ZeroDivisionError:
print("Cannot divide by zero")
finally:
print("Program finished")
1
2
3
# Example: Variables and Operators
a = 10
b = 5
sum = a + b
print("Sum =", sum)
1
2
3
# Example: If condition
num = int(input("Enter number: "))
if num % 2 == 0:
print("Even Number")
else:
print("Odd Number")
1
2
3
# Example: String slicing
text = "Python"
print(text[0:3])
1
2
3
# Example: List operations
numbers = [5,2,9,1]
[Link]()
print(numbers)
1
2
3
# Example: Exception handling
try:
a = 10
b = 0
print(a/b)
except ZeroDivisionError:
print("Cannot divide by zero")
finally:
print("Program finished")
1
2
3
# Example: Variables and Operators
a = 10
b = 5
sum = a + b
print("Sum =", sum)
1
2
3
# Example: If condition
num = int(input("Enter number: "))
if num % 2 == 0:
print("Even Number")
else:
print("Odd Number")
1
2
3
# Example: String slicing
text = "Python"
print(text[0:3])
1
2
3
# Example: List operations
numbers = [5,2,9,1]
[Link]()
print(numbers)
1
2
3
# Example: Exception handling
try:
a = 10
b = 0
print(a/b)
except ZeroDivisionError:
print("Cannot divide by zero")
finally:
print("Program finished")
1
2
3
# Example: Variables and Operators
a = 10
b = 5
sum = a + b
print("Sum =", sum)
1
2
3
# Example: If condition
num = int(input("Enter number: "))
if num % 2 == 0:
print("Even Number")
else:
print("Odd Number")
1
2
3
# Example: String slicing
text = "Python"
print(text[0:3])
1
2
3
# Example: List operations
numbers = [5,2,9,1]
[Link]()
print(numbers)
1
2
3
# Example: Exception handling
try:
a = 10
b = 0
print(a/b)
except ZeroDivisionError:
print("Cannot divide by zero")
finally:
print("Program finished")
1
2
3
# Example: Variables and Operators
a = 10
b = 5
sum = a + b
print("Sum =", sum)
1
2
3
# Example: If condition
num = int(input("Enter number: "))
if num % 2 == 0:
print("Even Number")
else:
print("Odd Number")
1
2
3
# Example: String slicing
text = "Python"
print(text[0:3])
1
2
3
# Example: List operations
numbers = [5,2,9,1]
[Link]()
print(numbers)
1
2
3
# Example: Exception handling
try:
a = 10
b = 0
print(a/b)
except ZeroDivisionError:
print("Cannot divide by zero")
finally:
print("Program finished")
1
2
3
# Example: Variables and Operators
a = 10
b = 5
sum = a + b
print("Sum =", sum)
1
2
3
# Example: If condition
num = int(input("Enter number: "))
if num % 2 == 0:
print("Even Number")
else:
print("Odd Number")
1
2
3
# Example: String slicing
text = "Python"
print(text[0:3])
1
2
3
# Example: List operations
numbers = [5,2,9,1]
[Link]()
print(numbers)
1
2
3
# Example: Exception handling
try:
a = 10
b = 0
print(a/b)
except ZeroDivisionError:
print("Cannot divide by zero")
finally:
print("Program finished")
1
2
3
# Example: Variables and Operators
a = 10
b = 5
sum = a + b
print("Sum =", sum)
1
2
3
# Example: If condition
num = int(input("Enter number: "))
if num % 2 == 0:
print("Even Number")
else:
print("Odd Number")
1
2
3
# Example: String slicing
text = "Python"
print(text[0:3])
1
2
3
# Example: List operations
numbers = [5,2,9,1]
[Link]()
print(numbers)
1
2
3
# Example: Exception handling
try:
a = 10
b = 0
print(a/b)
except ZeroDivisionError:
print("Cannot divide by zero")
finally:
print("Program finished")
1
2
3
# Example: Variables and Operators
a = 10
b = 5
sum = a + b
print("Sum =", sum)
1
2
3
# Example: If condition
num = int(input("Enter number: "))
if num % 2 == 0:
print("Even Number")
else:
print("Odd Number")
1
2
3
# Example: String slicing
text = "Python"
print(text[0:3])
1
2
3
# Example: List operations
numbers = [5,2,9,1]
[Link]()
print(numbers)
1
2
3
# Example: Exception handling
try:
a = 10
b = 0
print(a/b)
except ZeroDivisionError:
print("Cannot divide by zero")
finally:
print("Program finished")
1
2
3
# Example: Variables and Operators
a = 10
b = 5
sum = a + b
print("Sum =", sum)
1
2
3
# Example: If condition
num = int(input("Enter number: "))
if num % 2 == 0:
print("Even Number")
else:
print("Odd Number")
1
2
3
# Example: String slicing
text = "Python"
print(text[0:3])
1
2
3
# Example: List operations
numbers = [5,2,9,1]
[Link]()
print(numbers)
1
2
3
# Example: Exception handling
try:
a = 10
b = 0
print(a/b)
except ZeroDivisionError:
print("Cannot divide by zero")
finally:
print("Program finished")
1
2
3