马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
"""2022年6月4日20:44:48"""
main = 0
tool = 1
print("GO")
while tool == 1:
user_Input = (str(input(">>>")))
if user_Input == "+":
print(" ")
main = main + 1
if user_Input == "-":
print(" ")
main = main - 1
if user_Input == "<":
print(" ")
user_Input_temp = (str(input(">>>")))
main = main + user_Input_temp
if user_Input == ">":
print(" ")
user_Input_temp = (str(input(">>>")))
main = main - user_Input_temp
if user_Input == ".":
print(" ")
if main == "1":
print("a")
main = 0
if main == "2":
print("b")
main = 0
if main == "3":
print("c")
main = 0
if main == "4":
print("d")
main = 0
if main == "5":
print("e")
main = 0
if main == "6":
print("f")
main = 0
if main == "7":
print("g")
main = 0
if main == "8":
print("h")
main = 0
if main == "9":
print("i")
main = 0
if main == "10":
print("j")
main = 0
if main == "11":
print("k")
main = 0
if main == "12":
print("l")
main = 0
if main == "13":
print("m")
main = 0
if main == "14":
print("n")
main = 0
if main == "15":
print("o")
main = 0
if main == "16":
print("p")
main = 0
if main == "17":
print("q")
main = 0
if main == "18":
print("r")
main = 0
if main == "19":
print("s")
main = 0
if main == "20":
print("t")
main = 0
if main == "21":
print("u")
main = 0
if main == "22":
print("v")
main = 0
if main == "23":
print("w")
main = 0
if main == "24":
print("x")
main = 0
if main == "25":
print("y")
main = 0
if main == "26":
print("z")
main = 0
if main == "27":
print(",")
main = 0
if main == "28":
print("!")
main = 0
if main == "29":
print("?")
main = 0
if main == "30":
print(":")
main = 0
else:
print("您的输入不合法")
本帖最后由 jackz007 于 2022-6-4 23:44 编辑
我想问一下,代码中的变量 main 到底是整型数还是字符串,如果是整型数,main = 0 和 main = main + 1 都是正确的操作,但是,像 if main == '1' : 这样的操作就属于非法的了!
|