Ask coding questions

← Back to all posts
limited cards
CholsreaMMOS

is there any way to shuffle a deck, take a card/move it to a different list, then remove that card from the original dictionary, I've tried multiple ways but i cant figure out how to get it to work, my original way was to pick a random number then pop it, but it would almost always pick the same number twice before you can possibly finish.

Voters
CholsreaMMOS
Comments
hotnewtop
CosmicBear
CholsreaMMOS

@CosmicBear

sorry for the late response i tried this but i'm a bit confused and am getting a syntax error for almost all of it

(yes i replaced list and value)

CosmicBear

@CholsreaMMOS can you invite me to a repl?

MrVoo

You should try using del and try/except, it would make this easier