Python Questions

0 votes, 0 avg
656

Python Questions

1 / 15

1. Which of the following functions can help us to find the version of python that we are currently working on?

2 / 15

2. Which of the following statements are used in Exception Handling in Python?

3 / 15

3. The list.index(x[, start[, end]]) is used to ___.

4 / 15

4. Which of the following functions can be used to read data from a file using a file descriptor?

5 / 15

5. Which of the following types of loops are not supported in Python?

6 / 15

6. Which of the following is used to define a block of code in Python language?

7 / 15

7. How can assertions be disabled in Python?

8 / 15

8. What will be the output of the following code snippet?

square = lambda x: x ** 2
a = []
for i in range(5):
   a.append(square(i))
   
print(a)

9 / 15

9. Which of the following is a Python tuple?

10 / 15

10. Which one of the following syntaxes is the correct syntax to read from a simple text file stored in ”d:python.txt”?

11 / 15

11. What will be the output of the following Python function?

float(‘-infinity’)
float(‘inf’)

12 / 15

12. The process of pickling in Python includes ____________

13 / 15

13. What is called when a function is defined inside a class?

14 / 15

14. What will be the output of the following Python code?

places = ['Bangalore', 'Mumbai', 'Delhi']

places1 = places places2 = places[:]
places1[1]="Pune" places2[2]="Hyderabad" print(places)

15 / 15

15. What will be the datatype of the var in the below code snippet?

var = 10
print(type(var))
var = "Hello"
print(type(var))

Your score is

The average score is 40%

0%

Written by Shubhranshu Shekhar, who has trained 20000+ students in coding.

Scroll to Top