Q291. Is del the same as remove()? What are they?
del and remove() are methods on lists/ ways to eliminate elements. ```python >>> list=[3,4,5,6,7] ``` >>> del list[3] ```python >>> list ``` [3, 4, 5, 7] ```python >>> li...
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).
del and remove() are methods on lists/ ways to eliminate elements. ```python >>> list=[3,4,5,6,7] ``` >>> del list[3] ```python >>> list ``` [3, 4, 5, 7] ```python >>> li...
Let's create a text file on our Desktop and call it tabs.txt. To open it to be able to write to it, use the following line of code- ```python >>> file=open('tabs.txt','w'...
The methods append() and extend() work on lists. While append() adds an element to the end of the list, extend adds another list to the end of a list. Let's take two list...
We have the following modes- read-only – 'r' write-only – 'w' read-write – 'rw' append – 'a' We can open a text file with the option 't'. So to open a text file to read i...
map() executes the function we pass to it as the first argument; it does so on all elements of the iterable in the second argument. Let's take an example, shall we? ```py...
Yes, there is. Try running the following piece of code- ```python >>> list=[1,2,3,4,5 ``` >>> list.pop(–1) 5 ```python >>> list ``` [1, 2, 3, 4]
This is simple. All we need is the chr(x) built-in function. See how. ```python >>> chr(52) ``` '4' ```python >>> chr(49) ``` '1' ```python >>> chr(67) ``` 'C'
Sure does: Needs more function calls. Each function call stores a state variable to the program stack- consumes memory, can cause memory overflow. Calling a function cons...
**Recursion** is a programming technique where a function solves a problem by calling itself with smaller sub-instances of the same problem until reaching a **base case**...
I can think of three ways to do this. Using join- ```python >>> s='aaa bbb ccc ddd eee' ``` >>> s1=".join(s.split()) ```python >>> s1 ``` 'aaabbbcccdddeee' Using a list c...
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.