标签:技术分享 war 代码实现 put pytho com 计算 用户 输入输出
1 a = float(input("a=")) 2 b = float(input("b=")) 3 c = float(input("c=")) 4 p = (a+b+c)/2 5 area = (p*(p-a)*(p-b)*(p-c)) ** 0.5 6 print(‘三角形面积为 %0.2f‘ %area)
radius = float(input("输入半径:")) 2 area = 3.1415*radius*radius 3 print("{:.2f}".format(area))
1 import turtle 2 turtle.pensize(5) 3 turtle.circle(10) 4 turtle.circle(30) 5 turtle.circle(30) 6 turtle.circle(40) 7 turtle.circle(100)
显示如图:
import turtle turtle.forward(200) turtle.right(144) turtle.forward(200) turtle.right(144) turtle.forward(200) turtle.right(144) turtle.forward(200) turtle.right(144) turtle.forward(200)
1 import turtle 2 turtle.color("yellow") 3 turtle.fillcolor("yellow") 4 turtle.begin_fill() 5 turtle.forward(200) 6 turtle.right(144) 7 turtle.forward(200) 8 turtle.right(144) 9 turtle.forward(200) 10 turtle.right(144) 11 turtle.forward(200) 12 turtle.right(144) 13 turtle.forward(200) 14 turtle.right(144) 15 turtle.end_fill()
标签:技术分享 war 代码实现 put pytho com 计算 用户 输入输出
原文地址:http://www.cnblogs.com/wadee/p/7492117.html