Program 1:
Python find the output
x = 5
y = 3
print(x + y)
Program 2:
Python find the output
a = 10
b = 5
a = b
print(a)
Program 3
Python find the output
m = 7
n = 2
m = m + n
print(m)
Program 4
Python find the output
p = 8
q = 4
q = p / q
print(q)
Program 5
Python find the output
str1 = "Hello"
str2 = "World"
result = str1 + " " + str2
print(result)
Program 6
Python find the output
num1 = 10
num2 = 3
remainder = num1 % num2
print(remainder)
Program 7
Python find the output
a = 5
b = 2
c = a * b
print(c)
Program 8
Python find the output
name = "EasyExamNotes"
print("Hello, " + name)
Program 9
Python find the output
x = 5
y = 2
result = x // y
print(result)
Program 10
Python find the output
x = 10
y = 3
z = x % y
x = x / y
print(x, z)
Program 11
Python find the output
a = 5
b = 2
c = a ** b
print(c)
Program 12
Python find the output
name = "EasyExamNotes"
message = "Hello, " + name + "!"
print(message)
Program 13
Python find the output
p = 12
q = 5
p += q
q -= p
print(p, q)
Program 14
Python find the output
a = 7
b = 2
c = (a ** b) / (a % b)
print(c)
Program 15
Python find the output
str1 = "Easy"
str2 = "ExamNotes"
result = str1 * 3 + " " + str2
print(result)
Program 16
Python find the output
x = 5
if x > 3:
print("x is greater than 3")
else:
print("x is not greater than 3")
Program 17
Python find the output
age = 18
if age >= 18:
print("You are eligible to vote")
else:
print("You are not eligible to vote")
Program 18
Python find the output
num = 7
if num % 2 == 0:
print("Number is even")
else:
print("Number is odd")
Program 19
Python find the output
x = 10
if x > 5:
if x < 15:
print("x is between 5 and 15")
Program 20
Python find the output
num1 = 9
num2 = 5
if num1 > num2:
print("num1 is greater")
elif num1 < num2:
print("num2 is greater")
else:
print("Both numbers are equal")
Program 21
Python find the output
x = 15
if x > 10 and x < 20:
print("x is between 10 and 20")
else:
print("x is not in the range")
Program 22
Python find the output
x = 25
if x > 10 or x < 20:
print("x is either greater than 10 or less than 20")
else:
print("x is neither greater than 10 nor less than 20")
Program 23
Python find the output
x = 10
if x != 5:
print("x is not equal to 5")
else:
print("x is equal to 5")
Program 24
Python find the output
for i in range(5):
print(i)
Program 25
Python find the output
for i in range(2, 7):
print(i)
Program 25
Python find the output
count = 0
while count < 5:
print(count)
count += 1
Program 26
Python find the output
for i in range(3):
for j in range(2):
print(i, j)
Program 27
Python find the output
for i in range(5):
if i == 3:
break
print(i)
Program 28
Python find the output
for i in range(5):
if i == 3:
continue
print(i)
Program 29
Python
for i in range(4):
for j in range(2):
print(i, j)
if j == 1:
break
Program 30
Python find the output
numbers = [1, 2, 3, 4, 5]
for num in numbers:
print(num * 2)
Program 31
Python find the output
for i in range(5):
if i % 2 == 0:
print(i, "is even")
else:
print(i, "is odd")
Program 32
Python find the output
for i in range(1, 6):
if i == 3:
continue
print(i)
Program 33
Python find the output
num = 10
while num >= 0:
if num % 2 == 0:
print(num, "is even")
else:
print(num, "is odd")
num -= 1
Program 34
Python find the output
for i in range(5):
for j in range(i):
print("*", end=" ")
print()
Program 35
Python find the output
for i in range(1, 6):
if i % 2 == 0:
print(i, "is even")
else:
print(i, "is odd")
if i == 3:
break
Program 36
Python find the output
x = 1
y = 1
while x < 5:
if y < 3:
y += 1
else:
x += 1
print(x, y)
Program 37
Python find the output
for i in range(5):
if i == 3:
print("Skipping 3")
continue
print(i)