here is a code block answer deemed correct:

numerical_list[len(numerical_list)-1]

thousand_or_greater = []

for people in numerical_list:

name = people[0]

pop = people[1]

if pop >= 1000:

thousand_or_greater.append(name)

print(thousand_or_greater[0:10])

what I’d like to know is.

Is the code beneath which I came up with more efficient than setting variables within the for loop. it prints out the same result I just want to know if its ok to do?

my code=

numerical_list[len(numerical_list)-1]

thousand_or_greater = []

for people in numerical_list:

if people[1] >= 1000:

thousand_or_greater.append(people[0])

print(thousand_or_greater[0:10])

thanks in advance