PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
The code is modified to satisfy requirments!
"""
import random
cards =["A" ,"2" , "3","4","5","6","7","8","9","10","J","Q","K"]
suits = ["D","H","S","C"]
cards_dict = {}
print("Sorted cards are: ")
for j in range(4):
for i in range(13):
print(cards[i],'of',suits[j],end =";")
cards_dict[str(i)+str(j)] = cards[i]+" of "+ suits[j]
print("\nHow many shuffls you would like to have?")
for n in range (int(input())):
nos = []
for k in sorted(cards_dict.keys()):
nos.append(k)
print("\nShuffle No.",n+1)
r = random.randint(0,52)
for m in range(52):
i = (r + m )%52
print(cards_dict [nos [i]],end=";")
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run