brabra551
Coder
Hi guys
del is modifying tmp_deck and deck itself, how can I make tmp_deck temporary so I can modify tmp_deck in the loop and reset it to deck value for each round of the for loop ?
del is modifying tmp_deck and deck itself, how can I make tmp_deck temporary so I can modify tmp_deck in the loop and reset it to deck value for each round of the for loop ?
Code:
f = open("in.txt","r")
lines = f.readlines()
def search (deck):
for word in lines:
tmp_deck = deck
for letter in range(len(word)):
match = False
for element in range(len(tmp_deck)):
if match == False and word[letter] == tmp_deck[element]:
match = True
del tmp_deck[pion]