Python Essentials 1: BASICS


Module-2


                   

1 - A value returned by the 'input()' function is:
a) a float
b) a string
c) an integer
Solution: b) a string

2 - A 'keyword' is a word that:
a) is the most important word in the whole program
b) is the key to the puzzle
c) cannot be used as a variable name
Solution: c) cannot be used as a variable name

3 - Right-sided binding means that the following expression: '1 * 2 * 3" will be evaluated:
a) in random order
b) from left to right
c) from right to left
Solution: c) from right to left

4 - Only one of the following statements is TRUE - which one?
a) neither statement can be evaluated
b) addition precedes multiplication
c) multiplication precedes addition
Solution: c) multiplication precedes addition

5 - The result of the following addition '123 + 0.0':
a) cannot be evaluated
b) is equal to '123'
c) is equal to '123.0'
Solution: c) is equal to '123.0'

The '//' operator:

a) performs regular division
b) performs integer division
c) a decimal
Solution: b) a hexadecimal

7 - The most important difference between integer and floating-point numbers lies in the fact that:

a) they are stored differently in the computer memory
b) they cannot be used simultaneously
c) integers cannot be literals, while floats can
Solution: a) they are stored differently in the computer memory

8 - The meaning of the 'positional parameter' is determined by its:

a) appearance
b) name
c) position
Solution: c) position

9 - The 'escape character' owes its name to the fact that it:
a) cannot be caught due to its high speed
b) escapes from source files into the computer memory
c) changes the meaning of the character next to it
Solution: c) changes the meaning of the character next to it