1. What is the output of the following?
print('[email protected] a'.isprintable())
2. What is the output of the following?
print(''''''.isspace())
Correct Answer is : FALSE
3. What is the output of the following?
print('\t'.isspace())
4. What is the output of the following?
print('HelloWorld'.istitle())
Correct Answer is : FALSE
5. What is the output of the following?
print('Hello World'.istitle())
6. What is the output of the following?
print('[email protected]#World'.istitle())
7. What is the output of the following?
print('[email protected]'.lower())
Correct Answer is : [email protected]
8. What is the output of the following?
print('''
\tfoo'''.lstrip())
9. What is the output of the following?
print('xyyzxxyxyy'.lstrip('xyy'))
Correct Answer is : zxxyxyy
10. What is the output of the following?
print('xyxxyyzxxy'.lstrip('xyy'))
11. What is the output of the following?
print('cba'.maketrans('abc', '123'))
Correct Answer is : {97: 49, 98: 50, 99: 51}
12. What is the output of the following?
print('a'.maketrans('ABC', '123'))
Correct Answer is : {97: 49, 98: 50, 99: 51}
13. What is the output of the following?
print('abcdef'.partition('cd'))
Correct Answer is : (‘ab’, ‘cd’, ‘ef’)
14. What is the output of the following?
print('abcdefcdgh'.partition('cd'))
Correct Answer is : (‘ab’, ‘cd’, ‘efcdgh’)
15. What is the output of the following?
print('abcd'.partition('cd'))
Correct Answer is : (‘ab’, ‘cd’, ”)
16. What is the output of the following?
print('cd'.partition('cd'))
Correct Answer is : (”, ‘cd’, ”)
17. What is the output of the following?
print('abef'.partition('cd'))
Correct Answer is : (‘abef’, ”, ”)
18. What is the output of the following?
print('abcdef12'.replace('cd', '12'))
Correct Answer is : ab12ef12
19. What is the output of the following?
print('abef'.replace('cd', '12'))
20. What is the output of the following?
print('abcefd'.replace('cd', '12'))
Correct Answer is : abcefd