62
63def gen_list() -> list: # generate array size 1000 with random values from 1 to 1003
64 arr = []
65 for i in range(1000):66 rand = randint(1, 1003)
67 arr.append(rand)
68 return arr
An unused variable takes up space in the code, and can lead to confusion, and it should be removed. If this variable is necessary, name the variable _
to indicate that it will be unused, or start the name with unused
or _unused
.
def update():
for i in range(10): # Usused variable `i`
time.sleep(0.01)
display_result()
def update():
for _ in range(10):
time.sleep(0.01)
display_result()