n1=input('输入一个数字') n2=input('输入一个数字') n3=float(n1) + float(n2) print (float(n3))
n1=float(input('输入三角形边长1')) n2=float(input('输入三角形边长2')) n3=float(input('输入三角形边长3')) s=(n1+n2+n3)/2 area = (s*(s-n1)*(s-n2)*(s-n3))**0.5 print('三角形面积:%0.2f' %area)
r=float(input('请输入圆的半径')) area=3.1415*r*r print(area)
import turtle turtle.color('red') turtle.forward(500) turtle.right(144) turtle.forward(500) turtle.right(144) turtle.forward(500) turtle.right(144) turtle.forward(500) turtle.right(144) turtle.forward(500)
import turtle turtle.pensize(3) turtle.circle(15) turtle.circle(35) turtle.circle(55) turtle.circle(75) turtle.circle(95) turtle.circle(115) turtle.circle(135)
import turtle turtle.color('red') turtle.begin_fill() turtle.fillcolor('red') turtle.forward(500) turtle.right(144) turtle.forward(500) turtle.right(144) turtle.forward(500) turtle.right(144) turtle.forward(500) turtle.right(144) turtle.forward(500) turtle.end_fill()