Guest User

Untitled

a guest
Jan 7th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. from random import randint
  2. str = list('x' * 100)
  3. one = 0
  4. two = 0
  5. three = 0
  6. four = 0
  7. for i in range(0, len(str)):
  8.     while True:
  9.         y = (randint(0, 99))
  10.         if "x" in str[y]:
  11.             break
  12.     if one < 10:
  13.         str[y] = "1"
  14.         one = one + 1
  15.     elif two < 10:
  16.         str[y] = "2"
  17.         two = two + 1
  18.     elif three < 30:
  19.         str[y] = "3"
  20.         three = three + 1
  21.     elif four < 50:
  22.         str[y] = "4"
  23.         four = four + 1
  24. print("".join(str))
Advertisement
Add Comment
Please, Sign In to add comment