Python第二周作业
inp=input() l=len(inp) for i in range(l): if ord('A') <=ord(inp[i])<=ord('Z'): onew=ord('A')+((ord(inp[i])-ord('A'))+3)%26 elif ord('a') <=ord(inp[i])<=ord('z'): onew=ord('a')+((ord(inp[i])-ord('a')) + 3 )%26 else: onew=ord(inp[i]) new=chr(onew) print(new,end='') 凯撒密码B str=input("") left=0 for i in str: if i == "(": left += 1 elif i == ")": if left > 0: left -= 1 else: print("配对不成功") break else: if left != 0: print("配对不成功") else: print("配对成功") 括号配对检测 a=eval(input("")) b=pow((1.0+0.001*a),364) c=pow((1.0-0.001*a),364) d=int(b//c) print("{:.2f}, {:.2f}, {}".format(b,c,d)) 天天向上的力量B N=eval(input()