Python Interview Questions - 30 | Snaprecruit.com
Python Interview Questions - 30 | Snaprecruit.com
JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing
Enterprises
Python interview questions part 30
Python interview questions part 30
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? def to_upper(k): return k.upper() x = ['ab', 'cd'] print(list(map(upper, x)))
A. [‘AB’, ‘CD’].
B. [‘ab’, ‘cd’].
C. none of the mentioned
D. error
Show Correct Answer
Correct Answer is :
error
2. What is the output of the following? def to_upper(k): return k.upper() x = ['ab', 'cd'] print(list(map(to_upper, x)))
A. [‘AB’, ‘CD’].
B. [‘ab’, ‘cd’].
C. none of the mentioned
D. error
Show Correct Answer
Correct Answer is :
[‘AB’, ‘CD’].
3. What is the output of the following? def to_upper(k): k.upper() x = ['ab', 'cd'] print(list(map(to_upper, x)))
A. [‘AB’, ‘CD’].
B. [‘ab’, ‘cd’].
C. none of the mentioned
D. error
Show Correct Answer
Correct Answer is :
none of the mentioned
4. What is the output of the following? x = ['ab', 'cd'] print(map(len, x))
A. [‘ab’, ‘cd’].
B. [2, 2].
C. [‘2’, ‘2’].
D. none of the mentioned
Show Correct Answer
Correct Answer is :
none of the mentioned
5. What is the output of the following? x = ['ab', 'cd'] print(list(map(len, x)))
A. [‘ab’, ‘cd’].
B. [2, 2].
C. [‘2’, ‘2’].
D. none of the mentioned
Show Correct Answer
Correct Answer is :
[2, 2].
6. What is the output of the following? x = ['ab', 'cd'] print(len(map(list, x)))
A. [2, 2].
B. 2
C. 4
D. none of the mentioned
Show Correct Answer
Correct Answer is :
none of the mentioned
7. What is the output of the following? x = ['ab', 'cd'] print(len(list(map(list, x))))
A. 2
B. 4
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
2
8. What is the output of the following? x = ['ab', 'cd'] print(len(list(map(list, x))))))
A. 2
B. 4
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
error
9. What is the output of the following? x = ['ab', 'cd'] print(list(map(list, x)))
A. [‘a’, ‘b’, ‘c’, ‘d’].
B. [[‘ab’], [‘cd’]].
C. [[‘a’, ‘b’], [‘c’, ‘d’]].
D. none of the mentioned
Show Correct Answer
Correct Answer is :
[[‘a’, ‘b’], [‘c’, ‘d’]].
10. What is the output of the following? x = [12, 34] print(len(list(map(len, x))))
A. 2
B. 1
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
error
11. What is the output of the following? x = [12, 34] print(len(list(map(int, x))))
A. 2
B. 1
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
2
12. What is the output of the following? x = [12, 34] print(len(''.join(list(map(int, x)))))
A. 4
B. 2
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
error
13. What is the output of the following? x = [12, 34] print(len(''.join(list(map(str, x)))))
A. 4
B. 5
C. 6
D. error
Show Correct Answer
Correct Answer is :
4
14. What is the output of the following? x = [12, 34] print(len(' '.join(list(map(int, x)))))
A. 4
B. 5
C. 6
D. error
Show Correct Answer
Correct Answer is :
error
15. What is the output of the following? x = [12.1, 34.0] print(len(' '.join(list(map(str, x)))))
A. 6
B. 8
C. 9
D. error
Show Correct Answer
Correct Answer is :
9
16. What is the output of the following? x = [12.1, 34.0] print(' '.join(list(map(str, x))))
A. 12 1 34 0
B. 12.1 34
C. 121 340
D. 12.1 34.0
Show Correct Answer
Correct Answer is :
12.1 34.0
17. What is the output of the following? x = [[0], [1]] print(len(' '.join(list(map(str, x)))))
A. 2
B. 3
C. 7
D. 8
Show Correct Answer
Correct Answer is :
7
18. What is the output of the following? x = [[0], [1]] print((' '.join(list(map(str, x)))))
A. (‘[0] [1]’,)
B. (’01’,)
C. [0] [1].
D. 1
Show Correct Answer
Correct Answer is :
[0] [1].
19. What is the output of the following? x = [[0], [1]] print((' '.join(list(map(str, x))),))
A. (‘[0] [1]’,)
B. (’01’)
C. [0] [1].
D. 1
Show Correct Answer
Correct Answer is :
(‘[0] [1]’,)
20. What is the output of the following? x = [34, 56] print((''.join(list(map(str, x))),))
A. 3456
B. -3456
C. (‘3456’)
D. (‘3456’,)
Show Correct Answer
Correct Answer is :
(‘3456’,)
Similar Interview Questions
Search for latest jobs
Find Jobs