标签:pytho 第一条 form 一个 inpu res 半径 数字 code
num1 = input(‘the first number:‘)
num2 = input(‘the second number:‘)
sum = float(num1) + float(num2)
print(‘the result of {0} add {1} is {2}:‘.format(num1, num2, sum))
print(‘The result is:%.1f‘ %(float(input(‘input the first num:‘))+float(input(‘input the second num:‘))))
a = float(input(‘输入三角形第一条边长:‘))
b = float(input(‘输入三角形另一条条边长:‘))
c = float(input(‘输入三角形最后一条边长:‘))
s = (a + b + c)/2
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
print(‘此三角形面积为:%0.1f‘ %area)
r = float(input(‘输入半径:‘))
area = r * r * 3.14
print("圆的面积为{:.2f}".format(area))
import turtle
turtle.pensize(1)
turtle.circle(10)
turtle.circle(20)
turtle.circle(30)
import turtle
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
import turtle
turtle .begin_fill()
turtle.color(‘yellow‘)
turtle.forward(300)
turtle.left(144)
turtle.forward(300)
turtle.left(144)
turtle.forward(300)
turtle.left(144)
turtle.forward(300)
turtle.left(144)
turtle.forward(300)
turtle.end_fill()
标签:pytho 第一条 form 一个 inpu res 半径 数字 code
原文地址:http://www.cnblogs.com/fatmanwu/p/7491011.html