Python Concepts
Decision Making
Loops and Repetition
Identify the Output
Code Completion
100

This symbol is used for comments in Python.

#

100

This structure allows programs to make decisions.

if statement

100

This keyword repeats code.

loop

100

x = 5
print(x)

5

100

Complete the code to print numbers:

for i in _____(5):

range
200

This operator performs multiplication.

*

200

This block runs when all conditions are false.

else

200

This loop is used when the number of repetitions is known.

for loop

200

num = 10
if num > 5:
    print("Yes")

Yes

200

num = _____(input("Enter a number: "))

int

300

This operator checks equality between two values.

==

300

This keyword allows checking multiple conditions.

elif

300

This loop runs based on a condition.

while loop

300

x = 1
while x <= 3:
    print(x)
    x += 1

1

2

3

300

Complete the condition:

if num _____ 2 == 0:

%

400

Python commands are typed and executed here.

Python shell

400

This operator checks if one number is greater than another.

>

400

What does this print?

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

1
2
3

400

if 4 > 8:
    print("A")
else:
    print("B")

B

400

Fill in the blank to stop the loop.

if i == 4:
    _____

break

500

This command exits the Python shell.

quit()

500

This operator returns the remainder after division.

% (modulus)

500

What does this print?

for i in range(1,6):
    if i % 2 == 0:
        print(i)

2
4

500

x = 5
while x > 0:
    print(x)
    x -= 1

5
4
3
2
1

500

Fill in the blank to skip the current iteration.

if i == 5:
    _____

continue