Python作业。奥运五环。.画出如下图形

这篇博客介绍了如何使用Python进行图像处理,通过编程实现奥运五环的绘制,适合初学者了解Python在图形绘制方面的能力。
摘要由CSDN通过智能技术生成
# 开发时间: 2021/11/16 22:44
"""
画出奥运五环
"""
from tkinter import *

# 活值
start_x = int(input('请您输入起始坐标(x):'))
start_y = int(input('请您输入起始坐标(y):'))
w = int(input('请您输入圆环的宽度:'))
r = int(input("请您输入圆的直径:"))

root = Tk()
cv = Canvas(root, bg='white', width=2 * start_x + r / 4 * 10, height=2 * start_y + r / 2 * 3)
cv.create_oval(start_x, start_y, start_x + r, start_y + r, outline='blue', width=w)
cv.create_oval(start_x + r / 4 * 3, start_y, start_x + r / 4 * 3 + r, start_y + r, outline='black', width=w)
cv.create_oval(start_x + r / 4 * 6, start_y, start_x + r / 4 * 10, start_y + r, outline='red', width=w)
cv.create_oval(start_x + r / 4 * 5 - r / 8 * 7, start_y + r / 2, start_x + r / 4 * 5 - r / 8 * 7 + r,
               start_y + r / 2 * 3, outline='yellow', width=w)
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值