Skip to content

Instantly share code, notes, and snippets.

@rickysaltzer
Created August 14, 2012 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rickysaltzer/3351508 to your computer and use it in GitHub Desktop.
Save rickysaltzer/3351508 to your computer and use it in GitHub Desktop.
import random
some_cards = ["9 of hearts", "10 of diamonds", "5 of clubs", "king of spades", "king of clubs", "ace of spades"]
some_other_cards = ["9 of hearts", "10 of diamonds", "5 of clubs", "king of spades", "king of clubs", "ace of spades"]
new_cards = []
fancy_cards = []
for i in range(0,len(some_cards)-1):
new_cards.append(some_cards.pop(random.randint(0,len(some_cards)-1)))
print("New Cards:")
print(new_cards)
new_cards = [some_other_cards.pop(random.randint(0,len(some_other_cards)-1)) for i in range(0,len(some_other_cards)-1)]
print("\nFancy Cards:")
print(new_cards)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment