JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Python interview questions part 49
Python interview questions part 49
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. What is the output of the following? print('[email protected] a'.isprintable())
A. TRUE
B. FALSE
C. None
D. Error
Show Correct Answer
Correct Answer is :
TRUE
2. What is the output of the following? print(''''''.isspace())
A. TRUE
B. FALSE
C. None
D. Error
Show Correct Answer
Correct Answer is :
FALSE
3. What is the output of the following? print('\t'.isspace())
A. TRUE
B. FALSE
C. None
D. Error
Show Correct Answer
Correct Answer is :
TRUE
4. What is the output of the following? print('HelloWorld'.istitle())
A. TRUE
B. FALSE
C. None
D. Error
Show Correct Answer
Correct Answer is :
FALSE
5. What is the output of the following? print('Hello World'.istitle())
A. TRUE
B. FALSE
C. None
D. Error
Show Correct Answer
Correct Answer is :
TRUE
6. What is the output of the following? print('[email protected]#World'.istitle())
A. TRUE
B. FALSE
C. None
D. error
Show Correct Answer
Correct Answer is :
TRUE
7. What is the output of the following? print('[email protected]'.lower())
A. n
B. [email protected]
C. rn
D. r
Show Correct Answer
Correct Answer is :
[email protected]
8. What is the output of the following? print(''' \tfoo'''.lstrip())
A. \tfoo
B. foo
C. foo
D. none of the mentioned
Show Correct Answer
Correct Answer is :
foo
9. What is the output of the following? print('xyyzxxyxyy'.lstrip('xyy'))
A. error
B. zxxyxyy
C. z
D. zxxy
Show Correct Answer
Correct Answer is :
zxxyxyy
10. What is the output of the following? print('xyxxyyzxxy'.lstrip('xyy'))
A. zxxy
B. xyxxyyzxxy
C. xyxzxxy
D. none of the mentioned
Show Correct Answer
Correct Answer is :
zxxy
11. What is the output of the following? print('cba'.maketrans('abc', '123'))
A. {97: 49, 98: 50, 99: 51}
B. {65: 49, 66: 50, 67: 51}
C. 321
D. 123
Show Correct Answer
Correct Answer is :
{97: 49, 98: 50, 99: 51}
12. What is the output of the following? print('a'.maketrans('ABC', '123'))
A. {97: 49, 98: 50, 99: 51}
B. {65: 49, 66: 50, 67: 51}
C. {97: 49}
D. 1
Show Correct Answer
Correct Answer is :
{97: 49, 98: 50, 99: 51}
13. What is the output of the following? print('abcdef'.partition('cd'))
A. (‘ab’, ‘ef’)
B. (‘abef’)
C. (‘ab’, ‘cd’, ‘ef’)
D. 2
Show Correct Answer
Correct Answer is :
(‘ab’, ‘cd’, ‘ef’)
14. What is the output of the following? print('abcdefcdgh'.partition('cd'))
A. (‘ab’, ‘cd’, ‘ef’, ‘cd’, ‘gh’)
B. (‘ab’, ‘cd’, ‘efcdgh’)
C. (‘abcdef’, ‘cd’, ‘gh’)
D. error
Show Correct Answer
Correct Answer is :
(‘ab’, ‘cd’, ‘efcdgh’)
15. What is the output of the following? print('abcd'.partition('cd'))
A. (‘ab’, ‘cd’, ”)
B. (‘ab’, ‘cd’)
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
(‘ab’, ‘cd’, ”)
16. What is the output of the following? print('cd'.partition('cd'))
A. (‘cd’)
B. (”)
C. (‘cd’, ”, ”)
D. (”, ‘cd’, ”)
Show Correct Answer
Correct Answer is :
(”, ‘cd’, ”)
17. What is the output of the following? print('abef'.partition('cd'))
A. (‘abef’)
B. (‘abef’, ‘cd’, ”)
C. (‘abef’, ”, ”)
D. error
Show Correct Answer
Correct Answer is :
(‘abef’, ”, ”)
18. What is the output of the following? print('abcdef12'.replace('cd', '12'))
A. ab12ef12
B. abcdef12
C. ab12efcd
D. none of the mentioned
Show Correct Answer
Correct Answer is :
ab12ef12
19. What is the output of the following? print('abef'.replace('cd', '12'))
A. abef
B. 12
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
abef
20. What is the output of the following? print('abcefd'.replace('cd', '12'))
A. ab1ef2
B. abcefd
C. ab1efd
D. ab12ed2
Show Correct Answer
Correct Answer is :
abcefd
Similar Interview Questions
Search for latest jobs
Find Jobs