import os
def clear_screen():
os.system('cls' if os.name in ('nt', 'dos') else 'clear')
def match(user_selection):
print(f'You are {rck_ppr_scssr[user_selection]}')
print(rck_ppr_scssr[user_selection].upper())
def main_menu():
while True:
try:
clear_screen()
print(' '.join(rck_ppr_scssr))
print('\nEnter your selection:')
print('\n'.join([f'{i}. {rck_ppr_scssr[i]}.' for i in [1, 2, 3]]))
user_selection = int(input(': '))
if not user_selection in [1, 2, 3]:
clear_screen()
print('Select a number between 1 and 3')
input('Press ENTER to continue ')
continue
break
except:
clear_screen()
print('Please enter only digits')
input('Press ENTER to continue ')
continue
match(user_selection)
rck_ppr_scssr = ('', 'Rock', 'Paper', 'Scissor')
# for x in rck_ppr_scssr:
# f = open(f'{x}.x', 'r')
# tool.append(f.read())
# f.close()
go_again = 'y'
while go_again in ['y', 'yes']:
main_menu()
go_again = input('Keep playing? (Y/N): ').lower()