Q71. How is memory managed in Python?
Memory management in Python involves a private heap containing all Python objects and data structures. Interpreter takes care of Python heap and the programmer has no acc...
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).
Memory management in Python involves a private heap containing all Python objects and data structures. Interpreter takes care of Python heap and the programmer has no acc...
The **`__init__.py`** file indicates that the directory containing it should be treated as a regular **Python package namespace**. ### Key Functions of `__init__.py`: 1. ...
try: withopen('filename','r')asf: printf.read() exceptIOError: print"Nosuchfileexists" 75 How do we share global variables across modules in Python? We can create a confi...
Yes, Python supports multithreading via the standard library `threading` module. However, due to CPython's **Global Interpreter Lock (GIL)**, only one native thread execu...
Following is one possible solution there can be other similar ones: ```python import os ``` for dirname,dirnames,filenames in os.walk('.'): #printpathtoallsubdirectories...
Because Python strings are **immutable**, you cannot directly append characters to an existing string in memory. Each append creates a new string object: ### 1. The `+=` ...
Use the `.lower()` or `.casefold()` string method in Python: ```python s = 'MYSTRING' print(s.lower()) # Output: 'mystring' ``` *Tip:* `.casefold()` is recommended for ca...
The most readable, pythonic, and performant way to check if substring A exists inside string B is using the **`in` operator**: ```python str_b = "HireXTech Interview Prep...
There is no simple builtin string function that does what you're looking for, but you could use the more powerful regular expressions: >>>[m.start()forminre.finditer('te...
Python's GIL is intended to serialize access to interpreter internals from different threads. On multicore systems, it means that multiple threads can't effectively make...
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.