python综合作业题目_python作业 1、2、3 题

第一题:

import math

import turtle

RADIUS = 100

angleSin18 = math.sin(math.pi * 0.1) * RADIUS

angleCos18 = math.cos(math.pi * 0.1) * RADIUS

angleSin54 = math.sin(math.pi * 0.3) * RADIUS

angleCos54 = math.cos(math.pi * 0.3) * RADIUS

turtle.width(1)

turtle.fillcolor("red")

turtle.begin_fill()

turtle.penup()

turtle.goto(-angleCos18, angleSin18)

turtle.pendown()

turtle.goto(angleCos18, angleSin18)

turtle.goto(-angleCos54, -angleSin54)

turtle.goto(0, RADIUS)

turtle.goto(angleCos54, -angleSin54)

turtle.goto(-angleCos18, angleSin18)

turtle.end_fill()

第二题:

import turtle

turtle.setup(650,350,200,200)

turtle.penup()

turtle.pensize(1)

turtle.pencolor("red")

turtle.fd(100)

turtle.seth(30)

turtle.pendown()

turtle.fd(80)

turtle.seth(-90)

turtle.fd(80)

turtle.seth(150)

turtle.fd(80)

turtle.penup()

turtle.seth(30)

turtle.fd(80/3)

turtle.seth(90)

turtle.fd(80/3)

turtle.pendown()

turtle.seth(-30)

turtle.fd(80)

turtle.seth(-150)

turtle.fd(80)

turtle.seth(90)

turtle.fd(80)

第三题:

import turtle as t

t.setup(600, 600, None,None)

t.pu()

t.fd(-120)

t.pensize(5)

t.width(5)

t.pencolor("darkgreen")

t.pd()

t.fd(250)

t.seth(120)

t.pencolor("black")

t.fd(250)

t.seth(-120)

t.pencolor("blue")

t.fd(250)

t.pencolor("purple")

t.fd(250)

t.seth(0)

t.pencolor("green")

t.fd(250)

t.pencolor("gold")

t.fd(250)

t.seth(120)

t.pencolor("yellow")

t.fd(250)

t.seth(-120)

t.pencolor("grey")

t.fd(250)

t.seth(120)

t.pencolor("pink")

t.fd(250)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值