Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import choice
- possibilities = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 'a', 'b', 'c', 'd', 'e']
- winning_ticket = []
- print("Let's see what the winning ticket is...")
- # We don't want to repeat winning numbers or letters, so we'll use a
- # while loop.
- while len(winning_ticket) < 4:
- pulled_item = choice(possibilities)
- # Only add the pulled item to the winning ticket if it hasn't
- # already been pulled.
- if pulled_item not in winning_ticket:
- print(f" We pulled a {pulled_item}!")
- winning_ticket.append(pulled_item)
Add Comment
Please, Sign In to add comment