fork download
  1.  
  2. # 遊園地
  3.  
  4.  
  5. """
  6. 3.2以内   スペード
  7. 3.5位上6.5以内 ハート
  8. 6.8以上9.8以内 ダイヤ
  9. 10.0位上13.0以内 クローバー
  10. """
  11.  
  12. use1=[]
  13. use2=[]
  14.  
  15. Test1=[]
  16. Test2=[]
  17.  
  18. Nnomi1=[]
  19. Nnomi2=[]
  20.  
  21.  
  22.  
  23.  
  24. l=[i for i in range(1,53)]
  25.  
  26. import random
  27. random.shuffle(l)
  28.  
  29.  
  30. def Tes(xt):
  31. return [[i%13,round(i/4,1)] for i in xt]
  32.  
  33. def Sample(xx, yy, n=1):
  34. for i in range(n):card=random.choice(xx);yy.append(card);xx.remove(card)
  35.  
  36.  
  37. def Sample4(xa,xb,xc):
  38. global Test1,Test2
  39. Sample(l,xa,xb)
  40. xc=Tes(xa)
  41. print(xa,xc),print()
  42.  
  43.  
  44. Sample4(use1,5,Test1)
  45. Sample4(use1,5,Test1)
  46.  
  47.  
  48. def Sample2(xyz,TTT):
  49. for i in xyz:
  50. if i[1]<=3.2:
  51. TTT+=[[i[0],'♤']]
  52. elif i[1]>=3.5 and i[1]<=6.5:
  53. TTT+=[[i[0],'♡']]
  54. elif i[1]>=6.8 and i[1]<=9.8:
  55. TTT+=[[i[0],'♢']]
  56. elif i[1]>=10.0 and i[1]<=13.0:
  57. TTT+=[[i[0],'♧']]
  58.  
  59.  
  60. Sample2(Test1,Nnomi1)
  61. print(Nnomi1)
  62.  
Success #stdin #stdout 0.04s 11772KB
stdin
Standard input is empty
stdout
[30, 44, 45, 39, 18] [[4, 7.5], [5, 11.0], [6, 11.2], [0, 9.8], [5, 4.5]]

[30, 44, 45, 39, 18, 6, 43, 16, 31, 21] [[4, 7.5], [5, 11.0], [6, 11.2], [0, 9.8], [5, 4.5], [6, 1.5], [4, 10.8], [3, 4.0], [5, 7.8], [8, 5.2]]

[]