Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- str = list('x' * 100)
- one = 0
- two = 0
- three = 0
- four = 0
- for i in range(0, len(str)):
- while True:
- y = (randint(0, 99))
- if "x" in str[y]:
- break
- if one < 10:
- str[y] = "1"
- one = one + 1
- elif two < 10:
- str[y] = "2"
- two = two + 1
- elif three < 30:
- str[y] = "3"
- three = three + 1
- elif four < 50:
- str[y] = "4"
- four = four + 1
- print("".join(str))
Advertisement
Add Comment
Please, Sign In to add comment