Python Interview Questions - 61 | Snaprecruit.com
Python Interview Questions - 61 | Snaprecruit.com
JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing
Enterprises
Python interview questions part 61
Python interview questions part 61
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? for i in range(0): print(i)
A. 0
B. no output
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
no output
2. What is the output of the following? for i in range(2.0): print(i)
A. 0.0 1.0
B. 0 1
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
error
3. What is the output of the following? for i in range(2.0): print(i)
A. 0.0 1.0
B. 0 1
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
error
4. What is the output of the following? for i in range(int(2.0)): print(i)
A. 0.0 1.0
B. 0 1
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
0 1
5. What is the output of the following? for i in range(int(2.0)): print(i)
A. 0.0 1.0
B. 0 1
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
0 1
6. What is the output of the following? for i in range(float('inf')): print (i)
A. 0.0 0.1 0.2 0.3 …
B. 0 1 2 3 …
C. 0.0 1.0 2.0 3.0 …
D. none of the mentioned
Show Correct Answer
Correct Answer is :
none of the mentioned
7. What is the output of the following? for i in range(float('inf')): print (i)
A. 0.0 0.1 0.2 0.3 …
B. 0 1 2 3 …
C. 0.0 1.0 2.0 3.0 …
D. none of the mentioned
Show Correct Answer
Correct Answer is :
none of the mentioned
8. What is the output of the following? for i in range(int(float('inf'))): print (i)
A. 0.0 0.1 0.2 0.3 …
B. 0 1 2 3 …
C. 0.0 1.0 2.0 3.0 …
D. none of the mentioned
Show Correct Answer
Correct Answer is :
none of the mentioned
9. What is the output of the following? for i in range(int(float('inf'))): print (i)
A. 0.0 0.1 0.2 0.3 …
B. 0 1 2 3 …
C. 0.0 1.0 2.0 3.0 …
D. none of the mentioned
Show Correct Answer
Correct Answer is :
none of the mentioned
10. What is the output of the following? for i in [1, 2, 3, 4][::-1]: print (i)
A. 1 2 3 4
B. 4 3 2 1
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
4 3 2 1
11. What is the output of the following? for i in [1, 2, 3, 4][::-1]: print (i)
A. 1 2 3 4
B. 4 3 2 1
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
4 3 2 1
12. What is the output of the following? for i in ''.join(reversed(list('abcd'))): print (i)
A. a b c d
B. d c b a
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
d c b a
13. What is the output of the following? for i in ''.join(reversed(list('abcd'))): print (i)
A. a b c d
B. d c b a
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
d c b a
14. What is the output of the following? for i in 'abcd'[::-1]: print (i)
A. a b c d
B. d c b a
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
d c b a
15. What is the output of the following? for i in 'abcd'[::-1]: print (i)
A. a b c d
B. d c b a
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
d c b a
16. What is the output of the following? for i in '': print (i)
A. None
B. (nothing is printed)
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
(nothing is printed)
17. What is the output of the following? for i in '': print (i)
A. None
B. (nothing is printed)
C. error
D. none of the mentioned
Show Correct Answer
Correct Answer is :
(nothing is printed)
18. What is the output of the following? x = 2 for i in range(x): x += 1 print (x)
A. 0 1 2 3 4 …
B. 0 1
C. 45355
D. 0 1 2 3
Show Correct Answer
Correct Answer is :
45355
19. What is the output of the following? x = 2 for i in range(x): x += 1 print (x)
A. 0 1 2 3 4 …
B. 0 1
C. 45355
D. 0 1 2 3
Show Correct Answer
Correct Answer is :
45355
20. What is the output of the following? x = 2 for i in range(x): x -= 2 print (x)
A. 0 1 2 3 4 …
B. 0 -2
C. 0
D. error
Show Correct Answer
Correct Answer is :
0 -2
Similar Interview Questions
Search for latest jobs
Find Jobs