|
发表于 2020-5-27 18:18:07
|
显示全部楼层
type_password=input("您要翻译密码还是加密密码(翻译/加密):")
if type_password=="加密":
old_password=[int(x) for x in input("请输入您要加密的密码(六位数字):")]
num1=old_password[3]
num2=old_password[5]
num3=old_password[0]*old_password[5]
num4=old_password[2]
num5=old_password[1]*old_password[5]
num6=old_password[4]
new_password=[num1,num2,num3,num4,num5,num6]
print(new_password)
elif type_password=="翻译":
old_password=[int(x) for x in input("请输入加密后的密码,每一位用英文逗号隔开:").split(",")]
num1=int(old_password[2]/old_password[1])
num2=int(old_password[4]/old_password[1])
num3=old_password[3]
num4=old_password[0]
num5=old_password[5]
num6=old_password[1]
print(num1,num2,num3,num4,num5,num6)
else :
print("认真审题!") |
|