Posted on 26th July 2024|18 views
How to prepend a list in python?
Posted on 26th July 2024| views
Prepending to a list means adding an element to the inception of the list, for example, prepending 5 to [6, 7] results in [5. 6, 7]
Here is the example
Li1 = [6, 7]
Li1.insert = (0, 5)
print(Li1)
Output:
[5, 6, 7]