Advertisement
DrAungWinHtut

random.py

May 6th, 2023
868
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import random
  2.  
  3. one = 0
  4. two = 0
  5. three = 0
  6. four = 0
  7. five = 0
  8. six = 0
  9.  
  10.  
  11.  
  12. for i in range(100000):
  13.     dice = random.randint(1,6)
  14.     if dice == 1:
  15.         one += 1
  16.     elif dice == 2:
  17.         two += 1
  18.     elif dice == 3:
  19.         three += 1
  20.     elif dice == 4:
  21.         four += 1
  22.     elif dice == 5:
  23.         five += 1
  24.     elif dice == 6:
  25.         six += 1
  26.  
  27.     print(dice)
  28.  
  29.  
  30. print(one)
  31. print(two)
  32. print(three)
  33. print(four)
  34. print(five)
  35. print(six)
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement