Q81. Print the index of a specific item in a list?
In Python, you find the index of an element in a list using the **`list.index()`** method: ```python technologies = ['React', 'Python', 'Docker', 'PostgreSQL'] # Finding ...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (338 available).
In Python, you find the index of an element in a list using the **`list.index()`** method: ```python technologies = ['React', 'Python', 'Docker', 'PostgreSQL'] # Finding ...
You are looking for the enumerate function. It takes each element in a sequence (like a list) and sticks it's location right before it. For example: >>>my_list=['a','b','...
In early pythonversions, the sort function implemented a modified version of quicksort. However, it was deemed unstable and as of 2.3 they switched to using an adaptive ...
my_list=[(x,y,z)forxinrange(1,30)foryinrange(x,30)forzin range(y,30)ifx**2+y**2==z**2] It creates a list of tuples called my_list, where the first 2 elements are the perp...
Gather the arguments using the * and ** specifiers in the function's parameter list. This gives us positional arguments as a tuple and the keyword arguments as a dictiona...
A higherorder function accepts one or more functions as input and return s a new function. Sometimes it is required to use function as data To make high order function ,...
The syntax of map is: map(aFunction,aSequence) The first argument is a function to be executed for all the elements of the iterable given as the second argument. If the f...
Use list slicing with a step of 2 (`[::2]`): ```python numbers = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90] print(numbers[::2]) # Output: [0, 20, 40, 60, 80] ```
Yes, tuples in Python are **immutable**. Once created, their elements cannot be changed, added, or removed. Key implications: 1. **Hashability**: Tuples can be used as di...
Objects referenced from the global namespaces of Python modules are not always deallocated when Python exits. This may happen if there are circular references. There are...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.