from turtle import *
from random import *
speed(0)
penup()
goto(-190,0)
pendown()
for j in range(20):
x=randint(-200,200)
y=randint(-200,200)
penup()
goto(x, y)
pendown()
if x>0:
color('red')
else:
color('green')
begin_fill()
for i in range(4):
fd(30)
left(90)
end_fill()
# penup()
# goto(-190+(j+1)*50, 0)
# pendown()
input()
py画图_分界线画正方形(大于0为红色,小于为绿色)
原创
©著作权归作者所有:来自51CTO博客作者罡罡同学的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:第七届美亚杯备赛笔记
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
金属材料的熔池图像弱分界线提取
本文基于ImagePy作者给群友回答问题的讨论中整理而来,阅读需要发散思维,如有不解,可以查看代码链接。金属材料的熔池图像弱分界线提取问题底下这根分界线有什么方法能识别出来?1 问题来源...
计算机视觉 人工智能 opencv python java