Python Questions

0 votes, 0 avg
672

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 Boolean expressions is not logically equivalent to the other three?

3 / 15

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

4 / 15

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

x = 'abcd'
print(list(map(list, x)))

5 / 15

5. What is Instantiation in terms of OOP terminology?

6 / 15

6. Conditional statements are also known as ___ statements.

7 / 15

7. Is Python code compiled or interpreted?

8 / 15

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

print('abcdef'.partition('cd'))

9 / 15

9. Which of the following best describes inheritance?

10 / 15

10. Which of the following blocks will always be executed whether an exception is encountered or not in a program?

11 / 15

11. In Python, the break and continue statements, together are called ___ statement.

12 / 15

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

l=list('HELLO')
p=l[0], l[-1], l[1:3]
'a={0}, b={1}, c={2}'.format(*p)

13 / 15

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

numbers = (4, 7, 19, 2, 89, 45, 72, 22)
sorted_numbers = sorted(numbers)
even = lambda a: a % 2 == 0
even_numbers = filter(even, sorted_numbers)
print(type(even_numbers))

14 / 15

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

15 / 15

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

Your score is

The average score is 40%

0%

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

Scroll to Top