Exam Questions and CORRECT Answers
Which of the following is incorrect for a dictionary in Python?
a) each key must be unique
b) the key should be an immutable object
c) the len() function returns the sum of key-value elements in the dictionary
d) the len() function returns the numbers of key-value elements in the dictionary - CORRECT
ANSWER A each key must be unique.
02. Python name comes from which of the following?
a Python Café
b) Python Forest
c) Python snake
d) Monty Python's Flying Circus - CORRECT ANSWER D Monty pythons flying circus
03. What does the method items) returns in Python Dictionary?
a) The method items) returns the lists
b) The method items() returns the tuples
c) The method items) returns the keys in a list
d) The method items() returns the values in a list - CORRECT ANSWER The method item
returns tuples
04. A complete set of commands is known as:
a) Instruction list
, b) Code laws
c) Command-line
d) Command list - CORRECT ANSWER A instruction list
05. Which of the following are correct statements.
a) True + 1 evaluates to 2
b) True and False evaluates to False
c) True or False evaluates to False
d) 7+ False evaluates to False - CORRECT ANSWER A and b
06. Octal has the following base:
a) 2
b) 8
c) 10
d) 16 - CORRECT ANSWER B8
07. If a list passed into function's argument and modified inside the function:
a) Will affect the argument
b) Will not affect the argument
c) Will give an error
d) Will become global by default - CORRECT ANSWER A will affect the argument
Can you devid a string with a float - CORRECT ANSWER No
How many star characters will the following code show?
1i=0