python mcqs test 2

Python MCQs Test 2

Fill in your details and start your exam now!

1 / 20

What does the extend() method do in Python?

2 / 20

Which of the following is NOT a valid way to declare a variable in Python?

3 / 20

What is the output of the following code? \nprint("Hello".lower())

4 / 20

How do you check the length of a list named my_list in Python?

5 / 20

What is the output of the following code? \nprint(10 != 10)

6 / 20

What is the result of the expression 2 * 3 ** 2 in Python?

7 / 20

What does the range() function in Python return?

8 / 20

Which of the following is the correct way to open a file in Python, ensuring it gets closed properly afterward?

9 / 20

What does the pop() method do in Python?

10 / 20

What is the output of the following code? \npython\nx = 5\ny = 2\nprint(x % y)

11 / 20

What is the purpose of the continue statement in a loop?

12 / 20

What is the output of the following code? \nprint("Python".upper())

13 / 20

How do you comment multiple lines in Python?

14 / 20

What is the output of the following code? \nprint(8 < 6)

15 / 20

Which keyword is used to define a function in Python?

16 / 20

What is the output of the following code? \nprint("Python" * 3)

17 / 20

What does the __init__ method do in Python?

18 / 20

What is the result of the expression 2 == "2" in Python?

19 / 20

What does the append() method do in Python?

20 / 20

Which of the following statements is true about Python?

Your score is

The average score is 75%

0%

Scroll to Top