Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import sample
- alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- stream = []
- prev_chars = ["", "", ""]
- for _ in range(10):
- chars = sample(alphabet, 3)
- for boolean in (c1 == c2 for c1, c2 in zip(chars, prev_chars)):
- if boolean:
- print(f"Repeated letters {(chars, prev_chars)}. Resampling...")
- #chars = sample(alphabet, 3)
- break
- prev_chars = chars
- stream.append(chars)
- print(stream)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement