0% found this document useful (0 votes)
3 views3 pages

Output Finding Questions Revision Tour

The document contains 15 Python output-based questions that test understanding of flow control, including conditional statements, loops, and nested loops. Each question is designed to evaluate the ability to predict the output of various code snippets. The questions range from simple to moderate complexity.

Uploaded by

baipinky88868
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Output Finding Questions Revision Tour

The document contains 15 Python output-based questions that test understanding of flow control, including conditional statements, loops, and nested loops. Each question is designed to evaluate the ability to predict the output of various code snippets. The questions range from simple to moderate complexity.

Uploaded by

baipinky88868
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Sure!

Below are 15 Python output-based questions (simple to moderate) using conditional


statements, loops, and nested loops. These are great for testing understanding of flow control
and output prediction.

🔍 Python Output-Based Questions

Q1.

x = 10
if x > 5:
print("Greater")
else:
print("Smaller")

Q2.

for i in range(1, 4):


print(i * "*")

Q3.

n = 5
while n > 0:
print(n)
n -= 2

Q4.

for i in range(1, 6):


if i % 2 == 0:
print(i, "even")
else:
print(i, "odd")

Q5.

for i in range(3):
for j in range(2):
print(i, j)

Q6.

i = 1
while i <= 5:
if i == 3:
break
print(i)
i += 1
Q7.

for i in range(1, 4):


for j in range(1, i + 1):
print(j, end=" ")
print()

Q8.

x = 4
y = 2
if x > y and y != 0:
print("Valid")
else:
print("Invalid")

Q9.

for i in range(2, 6, 2):


for j in range(1, i):
print("*", end="")
print()

Q10.

n = 153
sum = 0
temp = n
while temp > 0:
digit = temp % 10
sum += digit ** 3
temp //= 10
print("Armstrong") if sum == n else print("Not Armstrong")

Q11.

for i in range(1, 4):


print("Row", i)
for j in range(1, 4):
print("Col", j)

Q12.

for i in range(1, 4):


for j in range(1, 4):
if i == j:
print(i * j, end=" ")
print()

Q13.

for i in range(3):
if i == 1:
continue
print("i =", i)

Q14.

a = 7
if a % 2 == 0:
print("Even")
elif a % 3 == 0:
print("Divisible by 3")
else:
print("Other")

Q15.

for i in range(1, 6):


for j in range(i):
print(i, end="")
print()

You might also like