当前位置:   article > 正文

python123答案-python123练习题.doc

turtle(circle(100*pow(2,0.5))

您所在位置:网站首页 > 海量文档

 > 计算机 > Python

productView-doc_46x35.gif

python123练习题.doc6页

本文档一共被下载:load.gif次,您可全文免费在线阅读后下载本文档。

donwloaddoc.png

favdoc.png

baiduyixia.png

edit.png

full.png

下载提示

1.本站不保证该用户上传的文档完整性,不预览、不比对内容而直接下载产生的反悔问题本站不予受理。

2.该文档所得收入(下载+内容+预览三)归上传者、原创者。

3.登录后可充值,立即自动返金币,充值渠道很便利

Hello World I

print('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))

温度转换 II

TempStr = 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))

货币转换 I

s = 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 turtle

for 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)

长度转换 I

s = 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 = "")

天天向上的力量 III

n = eval(input())

a = pow(

发表评论

请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。

用户名:

验证码:

detail-code.png

匿名?

发表评论

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/432833
推荐阅读
相关标签
  

闽ICP备14008679号