Select first in for loop

in need to do something with the first in a for loop.
something like this
list = [1,2,3,4]
for i in list:
print(i)
print(i[0] )

More like this

list = [1,2,3,4]
for i in list:
    print(i)

The indentation (white space) is very important for Python.
This loop can be read or interpreted as: go over each element from list, assigning that item to a variable named i and then displaying that variable before next cycle.

print(i[0] )

It doesn’t make any sense there, mostly because i does not contain an index (like array, or collections). It is a number.

If you want to only do something with the first element in a list, you do not need a loop.

print(list[0])

If you were to give more details to what you are trying to do, you might get more information.

thanks for the reaction.
this is my solution for my problem
def bestanden_verwijderen():
try:
destination_map = glob.glob(“path/*”)
bestand_dat_weg_moet =
destination_map.sort(key=os.path.getmtime)
for bestanden in destination_map:
print(bestanden)
bestand_dat_weg_moet.append(bestanden)
print(bestand_dat_weg_moet[0])
os.remove(bestand_dat_weg_moet[0])
except:
print(‘er zijn geen bestanden’)
pass

to remove a file in order of creation.
im quite new in python and sorry for my english.
is this correct this way ?
or are there other options?