Python Interview Questions | Snaprecruit.com
Python Interview Questions | Snaprecruit.com
JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing
Enterprises
Python interview questions part 60
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? x = 'abcd' for i in x: print(i) x.upper()
A. a B C D
B. a b c d
C. A B C D
D. error
Show Correct Answer
Correct Answer is :
a b c d
2. What is the output of the following? x = 'abcd' for i in x: print(i.upper())
A. a b c d
B. A B C D
C. a B C D
D. error
Show Correct Answer
Correct Answer is :
A B C D
3. What is the output of the following? x = 'abcd' for i in range(x): print(i)
A. a b c d
B. 0 1 2 3
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
error
4. What is the output of the following? x = 'abcd' for i in range(len(x)): print(i)
A. a b c d
B. 0 1 2 3
C. error
D. 1 2 3 4
Show Correct Answer
Correct Answer is :
0 1 2 3
5. What is the output of the following? x = 'abcd' for i in range(len(x)): print(i.upper())
A. a b c d
B. 0 1 2 3
C. error
D. 1 2 3 4
Show Correct Answer
Correct Answer is :
error
6. What is the output of the following? x = 'abcd' for i in range(len(x)): i.upper() print (x)
A. a b c d
B. 0 1 2 3
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
error
7. What is the output of the following? x = 'abcd' for i in range(len(x)): x[i].upper() print (x)
A. abcd
B. ABCD
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
abcd
8. What is the output of the following? x = 'abcd' for i in range(len(x)): i[x].upper() print (x)
A. abcd
B. ABCD
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
error
9. What is the output of the following? x = 'abcd' for i in range(len(x)): x = 'a' print(x)
A. a
B. abcd abcd abcd
C. a a a a
D. none of the mentioned
Show Correct Answer
Correct Answer is :
a a a a
10. What is the output of the following? x = 'abcd' for i in range(len(x)): print(x) x = 'a'
A. a
B. abcd abcd abcd abcd
C. a a a a
D. none of the mentioned
Show Correct Answer
Correct Answer is :
none of the mentioned
11. What is the output of the following? x = 123 for i in x: print(i)
A. 37623
B. 123
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
error
12. What is the output of the following? d = {0: 'a', 1: 'b', 2: 'c'} for i in d: print(i)
A. 36527
B. a b c
C. 0 a 1 b 2 c
D. none of the mentioned
Show Correct Answer
Correct Answer is :
36527
13. What is the output of the following? d = {0: 'a', 1: 'b', 2: 'c'} for x, y in d: print(x, y)
A. 36527
B. a b c
C. 0 a 1 b 2 c
D. none of the mentioned
Show Correct Answer
Correct Answer is :
none of the mentioned
14. What is the output of the following? d = {0: 'a', 1: 'b', 2: 'c'} for x, y in d.items(): print(x, y)
A. 36527
B. a b c
C. 0 a 1 b 2 c
D. none of the mentioned
Show Correct Answer
Correct Answer is :
0 a 1 b 2 c
15. What is the output of the following? d = {0: 'a', 1: 'b', 2: 'c'} for x in d.keys(): print(d[x])
A. 36527
B. a b c
C. 0 a 1 b 2 c
D. none of the mentioned
Show Correct Answer
Correct Answer is :
a b c
16. What is the output of the following? d = {0: 'a', 1: 'b', 2: 'c'} for x in d.values(): print(x)
A. 36527
B. a b c
C. 0 a 1 b 2 c
D. none of the mentioned
Show Correct Answer
Correct Answer is :
a b c
17. What is the output of the following? d = {0: 'a', 1: 'b', 2: 'c'} for x in d.values(): print(d[x])
A. 36527
B. a b c
C. 0 a 1 b 2 c
D. none of the mentioned
Show Correct Answer
Correct Answer is :
none of the mentioned
18. What is the output of the following? d = {0, 1, 2} for x in d.values(): print(x)
A. 36527
B. None None None
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
error
19. What is the output of the following? d = {0, 1, 2} for x in d: print(x)
A. 36527
B. {0, 1, 2} {0, 1, 2} {0, 1, 2}
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
36527
20. What is the output of the following? d = {0, 1, 2} for x in d: print(d.add(x))
A. 36527
B. 0 1 2 0 1 2 0 1 2 …
C. None None None
D. None of the mentioned
Show Correct Answer
Correct Answer is :
None None None
Similar Interview Questions
Search for latest jobs
Title
Location
Find Jobs