Q291. Explain help() and dir() functions in Python?
The help() function displays the documentation string and help for its argument. ```python >>> import copy ``` >>> help(copy.copy) Help on function copy in module copy: c...
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 (329 available).
The help() function displays the documentation string and help for its argument. ```python >>> import copy ``` >>> help(copy.copy) Help on function copy in module copy: c...
In Python, you retrieve dictionary keys using the **`.keys()`** method or by converting the dictionary directly to a `list`: ```python user = {'id': 101, 'username': 'ale...
A Python function returns values to its caller using the **`return`** statement: ### Return Behaviors: 1. **Single Value**: ```python def square(n): return n * n ``` 2. *...
Ten Built-in Functions, you say? Okay, here you go. complex()- Creates a complex number. ```python >>> complex(3.5,4) ``` (3.5+4j) eval()- Parses a string as an expressio...
When we want to execute a sequence of statements, we can give it a name. Let's def ine a function to take two numbers and return the greater number. ```python >>> def gre...
One of the less common functions with beginners, zip() return s an iterator of tuples. ```python >>> list(zip(['a','b','c'],[1,2,3])) ``` [('a', 1), ('b', 2), ('c', 3)] H...
While both files hold bytecode, .pyc is the compiled version of a Python file. It has platform-independent bytecode. Hence, we can execute it on any platform that support...
JavaScript doesn’t support namespaces by default. So if you create any element (function, method, object, variable) then it becomes global and pollutes the global namespa...
Even though JavaScript lacks namespaces, we can use Objects, an IIFE (Immediately Invoked Function Expression) or `let`/`const` to create namespaces. 1. **Using Object Li...
Sometimes, when we want to iterate over a list, a few methods come in handy. a. filter() Filter lets us filter in some values based on conditional logic. ```python >>> li...
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.