Python MCQ's Quiz-1

A colorful and engaging illustration representing Python programming with code snippets, a computer screen, and icons of Python libraries such as pandas and NumPy.

Python MCQs Quiz - Test Your Skills!

Welcome to the Python MCQs Quiz! This quiz is designed to assess your knowledge of Python programming through a series of multiple choice questions. Whether you're a beginner or an experienced developer, there's something here for everyone.

Test your understanding of:

  • Data Types
  • Control Structures
  • Error Handling
  • Built-in Functions
11 Questions3 MinutesCreated by CodingGuru202
What will be the datatype of the var in the below code snippet?

var = 10

print(type(var))

var = "Hello"

print(type(var))

Str and int
Int and int
Str and str
Int and str
How is a code block indicated in Python?
Block
Indentation
Key
None
What will be the output of the following code snippet?
a = [1, 2, 3, 4, 5]
sum = 0
for ele in a:
   sum += ele 
print(sum)
15
0
20
None

What will be the output of the following code snippet?

count = 0
while(True):
    if count % 3 == 0:
         print(count, end = " ")
    if(count > 15):
         break;
    count += 1

0 1 2 ....... 15
Infinite Loop
0 3 6 9 12 15
0 3 6 9 12
Which of the following statements are used in Exception Handling in Python?
Try
Except
Finally
All of the above
What will be the output of the following code snippet?
example = ["Sunday", "Monday", "Tuesday", "Wednesday"];
print(example[-3:-1])
['Monday',Tuesday]
['Sunday', 'Monday']
['Tuesday','Wednesday']
['Wednesday', 'Monday']
Which of the following is not a valid set operation in python?
Union
Intersection
Difference
None
Which of the following modules need to be imported to handle date time computations in Python?
Datetime
Date
Time
Timedate

What will be the output of the following code snippet?

a = [1, 2]
print(a * 3)
Error
[1,2]
[1,2,1,2]
[1,2,1,2,1,2]

What will be the output of the following code snippet?

a = 3 
b = 1
print(a, b)
a, b = b, a
print(a, b)
31 13
31 31
13 13
13 31
{"name":"Python MCQ's Quiz-1", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Welcome to the Python MCQs Quiz! This quiz is designed to assess your knowledge of Python programming through a series of multiple choice questions. Whether you're a beginner or an experienced developer, there's something here for everyone.Test your understanding of:Data TypesControl StructuresError HandlingBuilt-in Functions","img":"https://cdn.poll-maker.com/104-5100551/img-5vsgriqs0ym4elv5hqo7a7oj.jpg"}
Powered by: Quiz Maker