development

Python Cheatsheet: Part III

Lists my_list = [1,42,3,54,3,56,2] Delete an element # If you know the index del my_list[0] # Or you want to delete a slice del my_list[2:4] # if you want to delete the first occurrence my_list.remove(3) Concatenation >>> list1 = [34, 65] >>> list1 = list1 + [44, 77] >>> print(list1) [34, 65, 44, 77] Add […]

Read more