Multiple Choice Identify the
choice that best completes the statement or answers the question.
|
|
1.
|
In the following code, num is a ____?
num = ‘5’
a. | integer | c. | float | b. | string | d. | boolean |
|
|
2.
|
What is used to take input from the user in Python?
a. | scan( ) | c. | <> | b. | input( ) | d. | print( ) |
|
|
3.
|
The if..elif..else executes only one block of code among several
blocks.
a. | True | c. | It depends on expression used. | b. | False | d. | There is no elif statement in
Python |
|
|
4.
|
What is used to define a body of a loop?
a. | curly braces | c. | indentation | b. | parenthesis | d. | quotation |
|
|
5.
|
Which of the following statements is true?
a. | the break statement terminates the loop containing it | c. | the break and continue statements
are almost always used with the if, if...else, and if...elif...else statements. | b. | the continue
statement is used to skip the rest of the code inside the loop | d. | All of the
above. |
|
|
6.
|
Which of the following is correct?
a. | A variable name can start with a underscore | c. | Reserved words can be used as a
variable name | b. | A variable name can start with a digit | d. | A variable name can have symbols like: @, #, $
etc. |
|
|
7.
|
What will be printed with the following print statement?
print(‘2 +
2’)
|
|
8.
|
Comments are ignored by the Python interpreter. What symbol is needed at the
beginning of the comment?
|
|
9.
|
What is the output of the following code?
while 4 = =
4: print(‘4’)
a. | 4 is printed once | c. | 4 is printed infinitely until program closes | b. | 4 is printed four
times | d. | Syntax
error |
|
|
10.
|
What is used to concatenate two strings in Python?
a. | , operator | c. | ^ operator | b. | + operator | d. | # operator |
|