Skip to content
J2J Institute
Search
K
Main Navigation
Home
Jobs
Code here
Courses
Java
Core
Advanced
Python
SQL
PowerBI
Testing
Manual
Automation
Interview Questions
Java
Python
SQL
Manual
Automation
Quiz
Java
Python
SQL
Appearance
Menu
Return to top
On this page
Expert level python quiz
What will be the output of the following code: print('abc'.count('a', 0, 1))?
1
0
Error
None
What is the purpose of the `__del__()` method in Python?
It is used for object destruction
It initializes class attributes
It is used to finalize a class method
It prevents object deletion
Which of the following is true about the `asyncio` module in Python?
It allows asynchronous programming using coroutines
It is used for creating threads
It is used for file I/O operations
It simplifies multiprocessing
What will be the output of the following code: print(list(map(lambda x: x**2, range(3))))?
[0, 1, 4]
[0, 1, 2]
[1, 4, 9]
[0, 1, 3]
What is the time complexity of Python's built-in `list.append()` method?
O(1)
O(n)
O(log n)
O(n^2)
What is the purpose of the `yield from` expression in Python?
It allows you to delegate part of a generator's operations to another generator
It is used to return multiple values from a function
It is used to initialize a generator
It is used to create a closure
What will be the result of the following code: print(isinstance(3, (int, float)))?
True
False
Error
None
Which of the following is a feature of Python’s `multiprocessing` module?
It allows parallel execution of processes
It allows asynchronous function execution
It simplifies memory management in multithreading
It uses global interpreter lock (GIL)
What is the output of the following code: print(sorted([3, 1, 4, 1, 5], key=lambda x: x**2))?
[1, 1, 3, 4, 5]
[1, 1, 3, 4, 5]
[1, 1, 3, 4, 5]
[3, 1, 4, 1, 5]
Which of the following methods is used to create a weak reference to an object in Python?
weakref.ref()
ref()
del()
weak()
Submit