Python interview questions part 31

Python interview questions part 31

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 = [34, 56] print((''.join(list(map(str, x)))),)

Correct Answer is : 3456

2. What is the output of the following? x = [34, 56] print(len(map(str, x)))

Correct Answer is : error

3. What is the output of the following? x = 'abcd' print(list(map(list, x)))

Correct Answer is : [[‘a’], [‘b’], [‘c’], [‘d’]].

4. What is the output of the following? x = abcd print(list(map(list, x)))

Correct Answer is : none of the mentioned

5. What is the output of the following? x = 1234 print(list(map(list, x)))

Correct Answer is : none of the mentioned

6. What is the output of the following? x = 1234 print(list(map(list, [x])))

Correct Answer is : none of the mentioned

7. What is the output of the following? x = 'abcd' print(list(map([], x)))

Correct Answer is : none of the mentioned

8. Is Python code compiled or interpreted?

Correct Answer is : Python code is both compiled and interpreted

9. Which of these is the definition for packages in Python?

Correct Answer is : A folder of python modules

10. Which of these is false about a package?

Correct Answer is : Each import package need not introduce a namespace

11. What is returned by math.ceil(3.4)?

Correct Answer is : 4

12. What is the value returned by math.floor(3.4)?

Correct Answer is : 3

13. What is the output of print(math.copysign(3, -1))?

Correct Answer is : -3

14. What is displayed on executing print(math.fabs(-3.4))?

Correct Answer is : 3.4

15. Is the output of the function abs() the same as that of the function math.fabs()?

Correct Answer is : sometimes

16. What is the value returned by math.fact(6)?

Correct Answer is : error

17. What is the value of x if x = math.factorial(0)?

Correct Answer is : 1

18. What is math.factorial(4.0)?

Correct Answer is : 24

19. What is the output of print(math.factorial(4.5))?

Correct Answer is : error

20. What is math.floor(0o10)?

Correct Answer is : 8

Similar Interview Questions

    Search for latest jobs

    Icon
    Icon