| 1. |
The output of executing string.ascii_letters can also be achieved by:
|
||||||||
|
Answer:
Option (b) |
| 2. |
What will be the output of the following Python statement?
>>>"a"+"bc"
|
||||||||
|
Answer:
Option (d) |
| 3. |
What will be the output of the following Python statement?
>>>"abcd"[2:]
|
||||||||
|
Answer:
Option (c) |
| 4. |
What arithmetic operators cannot be used with strings?
|
||||||||
|
Answer:
Option (c) |
| 5. |
What will be the output of the following Python statement?
>>>print('new' 'line')
|
||||||||
|
Answer:
Option (c) |
| 6. |
What will be the output of the following Python code?
class father:
def __init__(self, param):
self.o1 = param
class child(father):
def __init__(self, param):
self.o2 = param
>>>obj = child(22)
>>>print "%d %d" % (obj.o1, obj.o2)
|
||||||||
|
Answer:
Option (d) |
| 7. |
Suppose s is “\t\tWorld\n”, what is s.strip()?
|
||||||||
|
Answer:
Option (d) |
| 8. |
Which of the following statement prints hello\example\test.txt?
|
||||||||
|
Answer:
Option (b) |
| 9. |
The format function, when applied on a string returns ___________
|
||||||||
|
Answer:
Option (d) |
| 10. |
What will be displayed by print(ord(‘b’) – ord(‘a’))?
|
||||||||
|
Answer:
Option (b) |