1import pygame
2from sys import exit 3
4
5pygame.init() # Initialize pygame
13 list[j + 1] = key
14
15
16list = [0, 12, 14, 21, 2, 3, 1, 4, 9, 10, 34]17insertionSort(list)
18print(list)
Defining a local variable or function with the same name as a built-in object makes the built-in object unusable within the current scope and makes the code prone to bugs.
dict = {} # dict is a Python builtin!
for idx, student in enumerate(students):
dict[student] = idx
roll_number = {}
for idx, student in enumerate(students):
roll_number[student] = idx