P 2
P 2
1.Example:
if x = 10:
print("x is equal to 10")
2.Example:
for i in range(10):
print(i)
3. Example:
my_variable = 5
print(my_vairable)
4.Example:
x = "5"
y = 10
result = x + y
5.Example:
my_list = [1, 2, 3, 4]
print(my_list[5])
6.Example:
7. Example:
my_list = [1, 2, 3, 4]
my_list.append(5)
my_list.add(6)
8. example
x= “10”
y= 5
Z=x+y
print(z)
9.Example
my_string = "Hello, world!"
my_string.reverse()
result = 1
for i in range(1, n):
result = result * i
return result
print(calculate_factorial(5))