-
What is the maximum length of a Python identifier?
a) 32
b) 128
c) No fixed length is specified
-
What will be the output of the following code snippet?
var = 10
print(type(var))
var = "hello"
print(type(var))
a) str and int
b) int and str
c) int and int
-
Which of the following types of loop are not supported in Python?
a) for
b) while
c) do-while
-
Which of the following blocks will always be executed whether an exception is encountered or not in a program?
a) try
b) except
c) finally
-
What is the keyword used in Python to raise an exception?
a) raise
b) try
c) goto
-
Which of the following modules needs to be imported to handle date-time computations in Python?
a) datetime
b) date
c) time
-
In which language is Python written?
a) C++
b) Java
c) C
-
What will be the output of the following code?
a = [1, 2, 3]
b = a
b[0] = 5
print(a)
a) [1, 2, 3]
b) [5, 2, 3]
c) [1, 2, 3, 5]