1
I have a list of lists, like: [ ('name1',size1), ('Nome2', size2)]
I want to print just the name of each list, how could I do it?
1
I have a list of lists, like: [ ('name1',size1), ('Nome2', size2)]
I want to print just the name of each list, how could I do it?
1
You can do it this way:
l = [('nome1', 1), ('nome2', 2)] # Cria lista de tuplas
for t in l:
print(t[0]) # Imprime o primeiro elemento da tupla
Browser other questions tagged python python-3.x list
You are not signed in. Login or sign up in order to post.