displace items in array python 1

displace items in array python

l = list(...)
l.insert(index, item)

Here is what the above code is Doing:
1. Create a list of strings
2. Insert the string “hey” at index 0
3. Insert the string “yo” at index 2
4. Insert the string “sup” at index 1
5. Insert the string “hello” at index 0

Similar Posts