I know that my question is most likely incorrectly formulated, but I could not express it in another way:
There are two lists: lst1, lst2. In lst2, we store lst1 with the .extend() method. And then change lst1.
The goal is to ensure that when lst1 changes, those changes are immediately transferred to lst2. How can this be implemented?
Here is a sample code:
lst1=  lst2= [2, 5] lst1.append(func_rand_num) lst2.extend(lst1) lst1= lst1() # we change lst1
We then expect lst2 to change...
- Compare custom list and list of lists (comparing lists of different lengths) Python
- python : List index out of range error, don't know how to fix it [duplicate]
- TypeError: 'list' object is not callable. Literally today I started learning Python and telebot API and I don’t understand what
- python : How to add an element from list 1 to a dictionary in list 2?
- python : Why does list.remove() incorrectly remove elements in a loop?
- python : Sending a file using telegramAPI
- Program for finding synonyms of Russian words python
- python : How to create a window in the game for example (dota2)