Python Questions

0 votes, 0 avg
568

Python Questions

1 / 15

1. What is Instantiation in terms of OOP terminology?

2 / 15

2. Study the following code:

x = [‘XX’, ‘YY’]
for i in a:
i.lower()
print(a)

What will be the output of this program?

3 / 15

3. How can assertions be disabled in Python?

4 / 15

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

5 / 15

5. Which keyword is used for function in Python language?

6 / 15

6. Which of the following is the proper syntax to check if a particular element is present in a list?

7 / 15

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

def unpack(a,b,c,d):
    print(a+d)
x = [1,2,3,4]
unpack(*x)

8 / 15

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

x = "abcdef"
i = "a"
while i in x:
    x = x[:-1]
    print(i, end = " ")

9 / 15

9. Which of the following is a Python tuple?

10 / 15

10. The process of pickling in Python includes ____________

11 / 15

11. As what datatype are the *kwargs stored, when passed into a function?

12 / 15

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

13 / 15

13.  Python supports the creation of anonymous functions at runtime, using a construct called __________

14 / 15

14. time.time() returns ________

15 / 15

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

Your score is

The average score is 37%

0%