>>> print(‘hello‘) hello
>>> a=float(input(‘输入三角形第一边长:‘)) 输入三角形第一边长:3 >>> b=float(input(‘输入三角形第二边长:‘)) 输入三角形第二边长:4 >>> c=float(input(‘输入三角形第三边长:‘)) 输入三角形第三边长:5 >>> s=(a+b+c)/2 >>> area=(s*(s-a)*(s-b)*(s-c))**0.5 >>> print(‘三角形面积为%0.2f‘ %area)
import turtle turtle.circle(10) turtle.circle(50) turtle.forward(100)turtle.color("yellow") turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(100) turtle.right(44) turtle.forward(100)
import turtle turtle.color("yellow") turtle.bgcolor("red") turtle.fillcolor("yellow") turtle.speed(1) turtle.begin_fill() for i in range(5): turtle.forward(200) turtle.right(144) turtle.end_fill()
时间: 2024-10-11 03:30:04