1、Hello World Iprint(Hello World)Hello World II(垂直)for name in “Hello World“: print(name) N 的多次方x = eval(input() for i in range(5): print(pow(x, i), end = ) print(pow(x,5) 温度转换 IITempStr = input() #print(eval(TempStr1:) if TempStr0 in F, f: C = (eval(TempStr1:) - 32) / 1.8 print(“C:.2f“.format(C) else
2、 : F = eval(TempStr1:) * 1.8 + 32 print(“F:.2f“.format(F) 货币转换 Is = input() if s0 in R, r: u = eval(s3:) / 6.78 print(“USD:.2f“.format(u) else: r = eval(s3:) * 6.78 print(“RMB:.2f“.format(r) turtle 正方形绘制import turtle turtle.setup(650, 350, 200, 200) turtle.penup() turtle.fd(-250) turtle.pendown() tu
3、rtle.pensize(2) turtle.pencolor(“black“) turtle.fd(50) for i in range(3): turtle.left(90) turtle.fd(50) turtle.done() turtle 六边形绘制import turtle turtle.setup(650, 350, 200, 200) turtle.penup() turtle.fd(-250) turtle.pendown() turtle.pensize(2) turtle.pencolor(“black“) turtle.fd(50) for i in range(5):
4、 turtle.left(60) turtle.fd(50) turtle.done() turtle 叠边形绘制import turtlefor i in range(9):turtle.fd(100)turtle.left(80)turtle 同切圆绘制import turtle turtle.setup(650, 350, 200, 200) turtle.penup() turtle.pendown() turtle.pensize(2) turtle.pencolor(“black“) for i in range(4): turtle.circle(30 + 10 * i, 360
5、) 长度转换 Is = input() if s-1 in m, M: y = eval(s:-1) * 39.37 print(“:.3fin“.format(y) else: x = eval(s:-2) / 39.37 print(“:.3fm“.format(x)平方值格式化n = pow(eval(input(), 2) if len(str(n) 20: print(n) else: print(“0:-20“.format(n) 同符号数学运算n = eval(input() N = abs(n) a = N + 10 b = N - 10 c = N * 10 if n = a and c = z: strp = strp:i + chr(ord(c) - ord(a) + 3) % 26 + ord(a) + strpi + 1: else: continue print(strp) 祖国的问候print(“祖国,您好! “)print(“我来了,学好 Python。“ )热量转换 I*