Quiz Control Flow

Python Quiz : Python Control Flow – 01

Python Quiz for Control Flow

Welcome to the “Python Quiz for Control Flow”! Mastering control flow structures is a pivotal step in one’s journey to become a proficient Python programmer. This quiz is designed to test your understanding of if-else logic, conditional statements, loops, and other control flow mechanisms in Python. Whether you’re a beginner looking to solidify your foundational knowledge or seeking a quick refresher, this quiz is tailored to challenge and reinforce your grasp on these essential constructs.

Prepare for the quiz: control flow methods

0%
11

Python Control Flow – 01

Level: Beginner

1 / 10

1. What is the output of the following code?

for i in range(1, 4):
  print(i)

2 / 10

2. What is the output of the following code?

if 1 != 1:
  print('Not Equal')
else:
  print('Equal')

3 / 10

3. What is the output of the following code?

if 1 < 2:
  print('A')
elif 2 < 3:
  print('B')
else:
  print('C')

4 / 10

4. What is the output of the following code?

if not(2 > 1):

  print('A')

else:

  print('B')

5 / 10

5. What is the output of the following code?

for i in range(1, 5, 2):
  print(i)

6 / 10

6. What is the output of the following code?

for i in range(3): print(i)

7 / 10

7. What is the output of the following code?

if 1 < 2: 
  print('A')
elif 2 < 3:
  print('B')
else:
  print('C')

8 / 10

8. What is the output of the following code?

if False:
  print('Yes')
else:
  print('No')

9 / 10

9. What is the output of the following code?

if 2 < 1:
  print('A')
elif 3 > 2:
  print('B')
else:
  print('C')```

10 / 10

10. What is the output of the following code?

if 2 > 1:
  print('True')
else:
  print('False')

Your score is

0%