JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Python interview questions part 5
Python interview questions part 5
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 function shown below? all([2,4,0,6])
A. Error
B. TRUE
C. FALSE
D.
Show Correct Answer
Correct Answer is :
FALSE
2. What is the output of the expression? round(4.5676,2)?
A. 4.5
B. 4.6
C. 4.57
D. 4.56
Show Correct Answer
Correct Answer is :
4.57
3. What is the output of the following function? any([2>8, 4>2, 1>2])
A. Error
B. TRUE
C. FALSE
D. 4>2
Show Correct Answer
Correct Answer is :
TRUE
4. What is the output of the function shown below? import math abs(math.sqrt(25))
A. Error
B. -5
C. 5
D. 5
Show Correct Answer
Correct Answer is :
5
5. What are the outcomes of the functions shown below? sum(2,4,6) sum([1,2,3])
A. Error, 6
B. 12, Error
C. 45632
D. Error, Error
Show Correct Answer
Correct Answer is :
Error, 6
6. What is the output of the function: all(3,0,4.2)
A. TRUE
B. FALSE
C. Error
D. 0
Show Correct Answer
Correct Answer is :
Error
7. What is the output of the functions shown below? min(max(False,-3,-4), 2,7)
A. 2
B. FALSE
C. -3
D. -4
Show Correct Answer
Correct Answer is :
FALSE
8. What are the outcomes of the following functions? chr(‘97’) chr(97)
A. a
B. ‘a’
C. Error
D. Error
Show Correct Answer
Correct Answer is :
Error
9. What is the output of the following function? complex(1+2j)
A. Error
B. 1
C. 2j
D. 1+2j
Show Correct Answer
Correct Answer is :
1+2j
10. What is the output of the function complex() ?
A. 0j
B. 0+0j
C. 0
D. Error
Show Correct Answer
Correct Answer is :
0j
11. The function divmod(a,b), where both ‘a’ and ‘b’ are integers is evaluated as:
A. (a%b, a//b)
B. (a//b, a%b)
C. (a//b, a*b)
D.
Show Correct Answer
Correct Answer is :
(a//b, a%b)
12. What is the output of the functions shown below? divmod(10.5,5) divmod(2.4,1.2)
A. (2.00, 0.50)
B. (2, 0.5)
C. (2.0, 0.5)
D. (2, 0.5)
Show Correct Answer
Correct Answer is :
(2.0, 0.5)
13. The function complex(‘2-3j’) is valid but the function complex(‘2 – 3j’) is invalid. State whether this statement is true or false.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
TRUE
14. What is the output of the function shown below? list(enumerate([2, 3]))
A. Error
B. [(1, 2), (2, 3)]
C. [(0, 2), (1, 3)]
D. [(2, 3)]
Show Correct Answer
Correct Answer is :
[(0, 2), (1, 3)]
15. What are the outcomes of the function shown below? x=3 eval('x^2')
A. Error
B. 1
C. 9
D. 6
Show Correct Answer
Correct Answer is :
1
16. What is the output of the functions shown below? float('1e-003') float('2e+003')
A. 3
B. 0.001
C. 0.001
D. Error
Show Correct Answer
Correct Answer is :
0.001
17. Which of the following functions does not necessarily accept only iterables as arguments?
A. enumerate()
B. all()
C. chr()
D. max()
Show Correct Answer
Correct Answer is :
chr()
18. Which of the following functions accepts only integers as arguments?
A. ord()
B. min()
C. chr()
D. any()
Show Correct Answer
Correct Answer is :
chr()
19. Suppose there is a list such that: l=[2,3,4]. If we want to print this list in reverse order, which of the following methods should be used?
A. reverse(l)
B. list(reverse[(l)])
C. reversed(l)
D. list(reversed(l))
Show Correct Answer
Correct Answer is :
list(reversed(l))
20. The output of the function: float(' -12345\n') (Note that the number of blank spaces before the number is 5)
A. -12345.0 (5 blank spaces before the number)
B. -12345
C. Error
D. -12345.000000000…. (infinite decimal places)
Show Correct Answer
Correct Answer is :
-12345
Similar Interview Questions
Search for latest jobs
Find Jobs