random.sample() returns a list (of cards in your case).
import random
x = ["a", "b", "c", "d", "e"]
ret = random.sample(x, 2)
print ret, type(ret)
woooee
Nearly a Posting Maven
2,454 posts since Dec 2006
Reputation Points: 777
Solved Threads: 714
In the future, you would probably receive more answers with a small block of code that illustrates what you want to do, rather than 135 lines of untested code.
val2 = raw_input("Vill du spela igen? Ja/Nej ")
val2 = "Ja"
while val2 != "Ja":
if val2 =="Ja":
A simple selection example:
import random
import string
choose_from = list(string.lowercase)
for j in range(5):
choices = random.sample(choose_from, 3)
print choices, "-->", choose_from, "\n"
choose_from = [x for x in choose_from if x not in choices]
woooee
Nearly a Posting Maven
2,454 posts since Dec 2006
Reputation Points: 777
Solved Threads: 714