所以我一直在尝试为我的firend做一个python程序,我做了(加入了两个不同的密码),并且我一直试图让每次打开和关闭程序时都很容易加密不同的字符串.我在64位Windows 7计算机上使用python 3.2.
这是我的代码(请同时给我一些改进的提示):
#!/usr/bin/python
#from string import maketrans # Required to call maketrans function.
print ("Welcome to the Rotten Bat encription program. Coded in python by Diego Granada")
answer = input("Please enter the password: ")
if answer == 'raindrops':
print("Password accepted")
else:
print ("Incorrect password. Quiting")
from time import sleep
sleep(3)
exit()
intab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
outtab = "N9Q2T1VWXYZ7B3D5F8H4JK60n9pq2st1vwxyz7b3d5f8h4jk60"
message = input("Put your message here: ")
print(message.translate(dict((ord(x), y) for (x, y) in zip(intab, outtab))))
print ("Thank you for using this …
Run Code Online (Sandbox Code Playgroud)