Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- #sets up list to pull strings from
- heroes = ['Barbarian King', 'Archer Queen', 'Shield Maiden', 'Countess', 'Monk', 'Royal Champion', 'Skeleton King']
- decklist = []
- #repeats twice: gives a random option from those listed, and prints it
- #first string is removed from the list to not be chosen twice, and added back after second string is chosen
- print('Choose your hero:')
- hero_choice_one = random.choice(heroes)
- print(f'Option 1: {hero_choice_one}')
- heroes.remove(hero_choice_one)
- hero_choice_two = random.choice(heroes)
- print(f'Option 2: {hero_choice_two}')
- heroes.append(hero_choice_one)
- #asks for an input of either of the two strings, and if entered string is not equal to the random strings chosen,
- #asks for input again. then adds choice to decklist(decklist is used for a larger chunk of code)
- deck_choice = input('Type the exact name of the hero you wish to choose.')
- while deck_choice != hero_choice_one or hero_choice_two:
- print('Please choose a hero from the two options(Type their names exactly as you see them)')
- deck_choice = input('Hero: ')
- decklist.append(deck_choice)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement