Python Mcqs
Q.1: What is the result of string.lower('RR')?)
A. RR'
B. 'lower'
C. 'rr'
D. rr
Q.2: What would be the result of: print not (True or False) ?8
A. TRUE
B. 1
C. 0
D. False
Q.3: The 'distutils' module provides
A. the packaging tools for Python
B. utility functions for calculating distance*
C. No Option
D. No Option
Q.4: What is the correct form for the first line of the switch operator?C
A. There is no switch operator in Python%
B. switch?
C. switch
D. switch:
Q.5: What syntax do you use when you create a subclass of an existing class?G
A. You cannot extend classes in Python#
B. SubclassName is subclass of BasicClassName*
C. class SubclassName(BasicClassName):#
D. class BasicClassName(SubclassName):#
Q.6: Which example would return "Python Supremacy"?.
A. "Python _".find("_", "Supremacy")!
B. "Python _".replace("_", "Supremacy")$
C. No Option
D. No Option
Q.7: What is a package?
A. Any Python program which imports external modules.2
B. All Python programs that are available on the computer.7
C. A folder with module files that can be imported together.9
D. Any folder with Python source code files in it./
Q.8: What does the expression "(lambda x: x + 3)(1)" return?7
A. 'lambda lambda lambda'
B. An anonymous function.
C. 4
D. 13
Q.9: Is it possible to swap values of variables a and b by using the expression 'a, b = b, a' ?Z
A. Yes, but only for string variables"
B. Yes, but only for numeric variables#
C. It is always possible.
D. No.
Q.10: If you want to enter accented characters, what is put in front of the string the character?[
A. d
B. g
C. G
D. u

Related Mcqs

All Subject Mcqs