I have 2 global lists:
hands={}
hand={}
Then I have function inside which I have while loop.
Once the hand is full it gets appended to the hands and after that hand should be cleared.
So I tried like this:
if len(hand)==2:
hands.append(hand)
hand.clear()
I tried to print the hands while the while loop is running and it's OK - it contains all the appended sub-lists with the appropriate content but once the loop is over - the hands list contains the sub-lists without any content in them. What am I missing?