# 开发时间: 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)
Python作业。奥运五环。.画出如下图形
最新推荐文章于 2023-10-27 16:03:26 发布