python123选择题题库及答案_python123练习题
python123练习题
(6页)
本资源提供全文预览,点击全文预览即可全文预览,如果喜欢文档就下载吧,查找使用更方便哦!
【python123选择题题库及答案_python123练习题】4.90 积分
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(TempStr[1:])) if TempStr[0] in ['F', 'f']: C = (eval(TempStr[1:]) - 32) / 1.8 print("C{:.2f}".format(C)) else : F = eval(TempStr[1:]) * 1.8 + 32 print("F{:.2f}".format(F)) 货币转换 Is = input() if s[0] in ['R', 'r']: u = eval(s[3:]) / 6.78 print("USD{:.2f}".format(u)) else: r = eval(s[3:]) * 6.78 print("RMB{:.2f}".format(r)) 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(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): 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) 长度转换 Is = input() if s[-1] in ['m', 'M']: y = eval(s[:-1]) * 39.37 print("{:.3f}in".format(y)) else: x = eval(s[:-2]) / 39.37 print("{:.3f}m".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 < 0: a = -abs(a) b = -abs(b) c = -abs(c) else: a = abs(a) b = abs(b) c = abs(c) print(N, a , b, c, end = "") 天天向上的力量 IIIn = eval(input()) a = pow(1 + (n / 1000), 365) b = pow(1 - (n / 1000), 365) c = a / b print("{0:.2f},{1:.2f},{2:.0f}".format(a, b, int(c)),end = "") 星号三角形 In = eval(input()) p = int((n + 1) / 2) for i in range(1, p + 1, 1): for j in range(p - i): print(" ", end = "") for k in range(2 * i - 1): print("*",end = "") for q in range(p - i): print(" ", end = "") print() 恺撒密码 Istrp = input() for i, c in zip(range(len(strp)), strp): if c >= 'a' and c <= 'z': strp = strp[:i] + chr((ord(c) - ord('a') + 3) % 26 + ord('a')) + strp[i + 1:] else: continue print(strp) 祖国的问候print("祖国,您好!") print("我来了,学好Python。")热量转换 I* 关 键 词: python123 练习题
天天文库所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
推荐阅读
- python123的答案_Python123题库完美答案——获得昨天和明天的日期
- #yyds干货盘点#Flutter 如何禁止手机横屏[Flutter专题32]
- 机器学习|机器学习期末练习题
- 做游戏应该选择云服务器还是物理服务器()
- 主页的宽度与主题中其他页面的宽度不同
- header_image()未在自定义主题中显示
- 在WordPress中使用PHP glob()时遇到问题
- Flutter 专题19 图解分享页面底部对话框 #yyds干货盘点#
- 我的page.php遇到问题
- WP重力表添加无显示