Skip to content

Instantly share code, notes, and snippets.

@CoutinhoElias
Created May 12, 2020 15:54
Show Gist options
  • Save CoutinhoElias/46b54e42624c996dd412679dc04bffde to your computer and use it in GitHub Desktop.
Save CoutinhoElias/46b54e42624c996dd412679dc04bffde to your computer and use it in GitHub Desktop.
Mover elementos de uma lista para outra.
def downGame():
games_in_table = []
baixar = [(1, 'C'), (2, 'C'), (3, 'C'), (4, 'C'), (5, 'C'), (6, 'C'), (7, 'C'), (8, 'C'), (9, 'C'), (10, 'C'), (11, 'C'), (12, 'C'), (13, 'C')]
cards_in_hands = [(3, 'C'), (6, 'C'), (2, 'E'), (6, 'E'), (7, 'E'), (11, 'E'), (12, 'E'), (3, 'O'), (13, 'O'), (5, 'P'), (6, 'P'), (9, 'P'),
(10, 'P'), (12, 'P')]
for i in cards_in_hands:
print(i)
if i in baixar:
games_in_table.append(i)
pos = cards_in_hands.index(i)
del(cards_in_hands[pos])
print(f'Excluido indice {pos} de cards_in_hands')
print(games_in_table)
downGame()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment