def mode(letter, mode_): #функция обработки числа
if mode_ is True:
j = ord(letter) * 2 - 9
else:
j = (ord(letter) + 9) / 2
return chr(abs(j))
def rebuild_code(password, mode_):
re_pass = [mode(i, mode_) for i in password]
return ''.join(re_pass)
print(rebuild_code('qrcx', True))
def Mode(letter, mode):
if CorD.capitalize().startswith('Code'):
print(rebuild_code(password, True))