wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Programming 2nd Quarter Long Quiz

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Which function is used to take input from the user in Python?

a)

read()

b)

input()

c)

scanf()

d)

get()

2.

Which function is used to display text to the user?

a)

display()

b)

echo()

c)

print()

d)

show()

3.

What type of data does the input() function return by default?

a)

Integer

b)

Float

c)

String

d)

Boolean

4.

Which parameter of the print() function prevents a new line after printing?

a)

stop

b)

end

c)

continue

d)

break

5.

Which operator performs integer division in Python?

a)

/

b)

//

c)

%

d)

**

6.

Which operator is used to find the remainder of a division?

a)

/

b)

//

c)

%

d)

**

7.

Which arithmetic operator has the highest precedence?

a)

+

b)

*

c)

/

d)

**

8.

What is the result type of the expression 5 / 2 in Python?

a)

Integer

b)

Float

c)

String

d)

Boolean

9.

Which keyword begins a conditional statement?

a)

else

b)

if

c)

when

d)

check

10.

What keyword checks another condition when the first if is false?

a)

elseif

b)

elif

c)

else if

d)

next

11.

The else block executes when:

a)

The if condition is true

b)

The if and all elif conditions are false

c)

The program ends

d)

An error occurs

12.

Which symbol is used for equality comparison in Python?

a)

=

b)

==

c)

!=

d)

===

13.

Which logical operator is used when both conditions must be true?

a)

and

b)

or

c)

not

d)

xor

14.

Which operator negates a condition?

a)

!

b)

~

c)

not

d)

-

15.

Which keyword creates a loop that repeats while a condition is true?

a)

for

b)

loop

c)

while

d)

repeat

16.

Which function is commonly used with for loops to generate numbers?

a)

sequence()

b)

numbers()

c)

range()

d)

count()

17.

What does the break statement do inside a loop?

a)

Skips the current iteration

b)

Ends the entire loop immediately

c)

Restarts the loop

d)

Ends the program

18.

What does the continue statement do?

a)

Exits the program

b)

Skips the rest of the code in the loop and goes to the next iteration

c)

Stops all loops

d)

Repeats the previous iteration

19.

Which method adds a new element to the end of a list?

a)

push()

b)

add()

c)

append()

d)

insert()

20.

What is true about tuples in Python?

a)

They are mutable

b)

They can be changed after creation

c)

They are immutable

d)

They cannot store strings