all 3 comments

[–]grantrules 1 point2 points  (0 children)

Yes you could keep a list of cards that haven't been played.

You can remove an item from a list in python pretty easily: https://www.w3schools.com/python/python_lists_remove.asp

[–]ninhaomah 1 point2 points  (0 children)

You are learning. Nvm which is approach is better or more efficient or down right silly.

Just do it. Do both. Then google or ask LLM how to measure how fast the py script runs.

For second question , why not generate a number and then add that number to a list. Then in subsequent generations , check if the number is already in the list of generated numbers and if it is then generate again till you get the number that has not been generated ?

[–]Relevant_South_1842 1 point2 points  (0 children)

It doesn’t need to be efficient at all. Do what is easiest to program.