## MCQs

Total Questions : 10
Question 1. What is answer of this expression, 22 % 3 is?
1.    7
2.    1
3.    0
4.    5

Modulus operator gives remainder. So, 22%3 gives the remainder, that is, 1.

Question 2. Which of the following will run without errors ?
1.    round(45.8)
2.    round(6352.898,2,5)
3.    round()
4.    round(7463.123,2,1)

Execute help(round) in the shell to get details of the parameters that are passed into the round function.

Question 3. What is the output of this expression, 3*1**3?
1.    27
2.    9
3.    3
4.    1

First this expression will solve 1**3 because exponential have higher precedence than multiplication, so 1**3 = 1 and 3*1 = 3. Final answer is 3.

Question 4. What does --------- 5 evaluate to?
1.    +5
2.    -11
3.    +11
4.    -5

x is equivalent to -(x+1).

Question 5. What dataype is the object below ?L = [1, 23, 'hello', 1].
1.    list
2.    dictionary
3.    array
4.    tuple

List datatype can store any values within it.

Question 6. What is the result of round(0.5) “ round(-0.5)?
1.    1.0
2.    2.0
3.    0.0
4.    None of the mentioned

Python rounds off numbers away from 0 when the number to be rounded off is exactly halfway through. round(0.5) is 1 and round (-0.5) is -1.

Question 7. What is the maximum possible length of an identifier?
1.    31 characters
2.    63 characters
3.    79 characters
4.    none of the mentioned
Answer: Option D. -> none of the mentioned

Identifiers can be of any length.

Question 8. All keywords in Python are in
1.    lower case
2.    UPPER CASE
3.    Capitalized
4.    None of the mentioned
Answer: Option D. -> None of the mentioned

True, False and None are capitalized while the others are in lower case.

Question 9. Which of these in not a core datatype?
1.    Lists
2.    Dictionary
3.    Tuples
4.    Class

Class is a user defined datatype.

Question 10. Which of the following is an invalid statement?
1.    abc = 1,000,000
2.    a b c = 1000 2000 3000
3.    a,b,c = 1000, 2000, 3000
4.    a_b_c = 1,000,000
Answer: Option B. -> a b c = 1000 2000 3000

Spaces are not allowed in variable names.