Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def delay():
- time.sleep(1)
- class Character :
- races = ['human', 'orc']
- def __init__(self):
- self.name = input('Введите свое имя: ')
- def setRace(self):
- while True:
- try:
- self.race = self.races[int(input(f'''
- Введите цифру соответствующую выбранной вами рассе:
- {', '.join([str(num + 1)+ '. ' + val for num, val in list(enumerate(self.races))])}
- Ваш выбор:
- ==> ''')) - 1]
- except Exception:
- print('Вы ввели неверное число! Попробуйте снова')
- else:
- break
- player = Character()
- player.setRace()
- print(f'''
- Ваше имя - {player.name},
- Ваша расса - {player.race}
- ''')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement