I just want to add every entry of a list in lowercase by using lower(). I am using this code to do the task:
MyList = ["EntryOne", "EntryTwo"]
TempList = MyList #cloning MyList to TempList
for v in TempList:
MyList.append(v.lower()) #Why is it also being appended into TempList ?
print(MyList)
print(TempList)
#expected output:
#["EntryOne", "EntryTwo", "entryone", "entrytwo"]
#["EntryOne", "EntryTwo"]
As you can see, the declaration of TempList is outside of the for loop, i am just declaring it at the beginning. There is no code in which Im appending the lowercase into TempList.
As a result this script loops forever.