How to declare and add items to an array in Python?
{} represents an empty dictionary, not an array/list. For lists or arrays, you need []. To initialize an empty list do this: my_list = [] or my_list = list() To add elements to the list, use append my_list.append(12) To extend the list to include the elements from another list use extend my_list.extend([1,2,3,4]) my_list –> [12,1,2,3,4] … Read more