Education logo

Python MCQ Multiple Choice Questions

Python MCQ Multiple Choice Questions

By renukaPublished 2 years ago 3 min read
Like
Python MCQ Multiple Choice Questions
Photo by Chris Ried on Unsplash

1000+ Multiple Choice Questions & Answers on Python arranged chapterwise! Start practicing now for exams, online tests, quizzes & interviews! Python MCQ 1000+ Multiple Choice Questions & Answers on Python arranged chapterwise! Start practicing now for exams, online tests, quizzes & interviews! Python MCQ Python Multiple Choice Questions (MCQ Quiz) with answers and detailed solutions. Download these Free Python MCQ Quiz | Python MCQ Quiz & Online Test: We have listed here the best Python MCQ Questions, that check your basic knowledge of Python Programming

1. Who developed Python Programming Language?

a) Wick van Rossum

b) Rasmus Lerdorf

c) Guido van Rossum

d) Niene Stom

Answer:- C

2. Which type of Programming does Python support?

a) object-oriented programming

b) structured programming

c) functional programming

d) all of the mentioned

Answer:- D

3. Is Python case sensitive when dealing with identifiers?

a) no

b) yes

c) machine dependent

d) none of the mentioned

Answer:- A

4. Which of the following is the correct extension of the Python file?

a) .python

b) .pl

c) .py

d) .p

Answer:- C

5. All keywords in Python are in _________

a) Capitalized

b) lower case

c) UPPER CASE

d) None of the mentioned

Answer:- D

6. What will be the value of the following Python expression?

4 + 3 % 5

a) 7

b) 2

c) 4

d) 1

Answer:- A

7. Which of the following is used to define a block of code in Python language?

a) Indentation

b) Key

c) Brackets

d) All of the mentioned

Answer:- A

8. What will be the output of the following Python code?

i = 1

while True:

if i%3 == 0:

break

print(i)

 

i + = 1

a) 1 2 3

b) error

c) 1 2

d) none of the mentioned

9. What are the values of the following Python expressions?

2**(3**2)

(2**3)**2

2**3**2

a) 512, 64, 512

b) 512, 512, 512

c) 64, 512, 64

d) 64, 64, 64

Answer:- A

10. What will be the output of the following Python code?

l=[1, 0, 2, 0, 'hello', '', []]

list(filter(bool, l))

a) [1, 0, 2, ‘hello’, ”, []]

b) Error

c) [1, 2, ‘hello’]

d) [1, 0, 2, 0, ‘hello’, ”, []]

Answer:- C

11. What will be the output of the following Python function?

min(max(False,-3,-4), 2,7)

a) -4

b) -3

c) 2

d) False

Answer:- D

12. What will be the output of the following Python expression if x=56.236?

print("%.2f"%x)

a) 56.236

b) 56.23

c) 56.0000

d) 56.24

Answer:- D

13. What will be the output of the following Python function?

len(["hello",2, 4, 6])

a) Error

b) 6

c) 4

d) 3

Answer:- C

14. What will be the output of the following Python code?

x = 'abcd'

for i in x:

print(i.upper())

a) a B C D

b) a b c d

c) error

d) A B C D

Answer:- D

15. Which of the following Python statements will result in the output: 6?

A = [[1, 2, 3],

[4, 5, 6],

[7, 8, 9]]

a) A[2][1]

b) A[1][2]

c) A[3][2]

d) A[2][3]

Answer:- B

16. What will be the output of the following Python program?

def foo(x):

x[0] = ['def']

x[1] = ['abc']

return id(x)

q = ['abc', 'def']

print(id(q) == foo(q))

a) Error

b) None

c) False

d) True

Answer:- D

17. Which of the following is not a core data type in Python programming?

a) Tuples

b) Lists

c) Class

d) Dictionary

Answer:- C

18. The following python program can work with ____ parameters.

def f(x):

def f1(*args, **kwargs):

print("Sanfoundry")

return x(*args, **kwargs)

return f1

a) any number of

b) 0

c) 1

d) 2

Answer:- A

Answer:- B

student
Like

About the Creator

renuka

i am a blogger. https://mcqmaster.in

Reader insights

Be the first to share your insights about this piece.

How does it work?

Add your insights

Comments

There are no comments for this story

Be the first to respond and start the conversation.

Sign in to comment

    Find us on social media

    Miscellaneous links

    • Explore
    • Contact
    • Privacy Policy
    • Terms of Use
    • Support

    © 2024 Creatd, Inc. All Rights Reserved.