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='')
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))
N=eval(input()) a=abs(N) if N<0: b=-abs(a+10) c=-abs(a-10) d=-abs(a*10) else: b=abs(a+10) c=abs(a-10) d=abs(a*10) print(a,int(b),int(c),int(d),end="")
n=eval(input()) while n!=1 and n!=4: num=list(str(n)) n=0 for i in num: n+=int(i)**2 if n==1: print("True") else: print("False")
n = input() for i in n: if ord("a") <= ord(i) <= ord("z"): print(chr(ord('z')-(ord(i)-ord('a'))),end='') elif ord("A") <= ord(i) <= ord("Z"): print(chr(ord('Z')-(ord(i)-ord('A'))),end='') else: print(i,end='')
a=eval(input()) b=eval(input()) print(round(a*b,2))
a=eval((input())) print("{:.3f}".format(a))
s=input() def str_reverse1(s): return s[::-1] if __name__ == '__main__': rs = str_reverse1(s) print(rs)
a = int(input()) b = 1 for i in range(1, a+1): b = b*i print("{}".format(b))