We all wait for summer

Python MCQ 02


1. Python supports the creation of anonymous functions at runtime, using a construct called
a) pi
b) anonymous
c) lambda
d) none of the mentioned
Answer: c
2. What is the order of precedence in python?
a) Exponential, Parentheses, Multiplication, Division, Addition, Subtraction
b) Exponential, Parentheses, Division, Multiplication, Addition, Subtraction
c) Parentheses, Exponential, Multiplication, Division, Subtraction, Addition
d) Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
Answer: d
3. What does pip stand for python?
a) Pip Installs Python
b) Pip Installs Packages
c) Preferred Installer Program
d) All of the mentioned
Answer: c
4. Which of the following is the truncation division operator in Python?
a) |
b) //
c) /
d) %
Answer: b
5. Which of the following is not a core data type in Python programming?
a) Tuples
b) Lists
c) Class
d) Dictionary
Answer: c
6. Which module in the python standard library parses options received from the command line?
a) getarg
b) getopt
c) main
d) os
Answer: b
7. What arithmetic operators cannot be used with strings in Python?
a) *
b) –
c) +
d) All of the mentioned
Answer: b
8. To add a new element to a list we use which Python command?
a) list1.addEnd(5)
b) list1.addLast(5)
c) list1.append(5)
d) list1.add(5)
Answer: c
9. Which one of the following is the use of function in python?
a) Functions don’t provide better modularity for your application
b) you can’t also create your own functions
c) Functions are reusable pieces of programs
d) All of the mentioned
Answer: c
10. What is the maximum possible length of an identifier in Python?
a) 79 characters
b) 31 characters
c) 63 characters
d) none of the mentioned
Answer: d