I have a list of lists, like this: [('name1', size1), ('name2', size2)]
I want to just print the name of each list, how could I do that?
I have a list of lists, like this: [('name1', size1), ('name2', size2)]
I want to just print the name of each list, how could I do that?
You can do this as follows:
l = [('nome1', 1), ('nome2', 2)] # Cria lista de tuplas
for t in l:
print(t[0]) # Imprime o primeiro elemento da tupla