By the by...there is a fatal flaw in my code...*AND* in your original code!
There is *NOTHING* to prevent the SAME CARD from being picked for both cards!!!
That's because you pick the two cards completely independently of each other.
The *right* way to do this is to shuffle the deck and then just deal the top two cards off the top of the deck.
But if you only ever need two cards, it's sufficient to just check the 2nd against the 1st and loop until the 2nd doesn't match the 1st.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.