llgd.net
当前位置:首页 >> 求问怎样用python/python turtlE画"心" >>

求问怎样用python/python turtlE画"心"

naive # !/usr/bin/python3.4# -*- coding: utf-8 -*-print('\n'.join([''.join([('TTybTTyb'[(x-y)%7]if((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3

import turtlea = turtle.Turtle()def drawlove(): a.left(45) a.forward(30) a.right(45) a.forward(30) a.right(120) a.forward(110) a.penup() a.right(150) a.forward(75) a.pendown() a.left(45) a.forward(30) a.left(45) a.forward(30) a...

python turtle画4个同心圆方法 import turtle #draw first circle turtle.penup() turtle.goto(0,-200) turtle.pendown() turtle.circle(200) #draw second circle turtle.penup() turtle.goto(0,-150) turtle.pendown() turtle.circle(150) #dr...

#!/usr/bin/python3.4# -*- coding: utf-8 -*-print('\n'.join([''.join([('TTybTTyb'[(x-y)%7]if((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3

import turtlea = turtle.Turtle()def drawlove(): a.left(45) a.forward(30) a.right(45) a.forward(30) a.right(120) a.forward(110) a.penup() a.right(150) a.forward(75) a.pendown() a.left(45) a.forward(30) a.left(45) a.forward(30) a...

# -*- coding: utf-8 -*-import numpy as npimport matplotlib.pyplot as pltfig, ax = plt.subplots()x=np.linspace(-10,10,1000)y=np.linspace(-10,10,1000)X,Y = np.meshgrid(x,y)Z=X**2 +(Y-1.5*X**(2/3))**2-1ax.contour(-1*X,Y,Z,[1,5,10,...

import numpy as npimport pylab as pltfrom matplotlib import colors a = [[] for i in range(1000)] i = 0while i < 1000:j = 0while j < 1000:x = -1.8 + 0.003*iy = -1.4 + 0.0028*jz = y**2 + (-x - (y**2)**0.33333)**2if z

是要表白么,嘿嘿,希望这个代码能帮到你哦~(参数不满意可以自己调) import turtleimport mathwn = turtle.Screen()wn.setworldcoordinates(-2, -2, 2, 2)alex = turtle.Turtle()alex.color("red")alex.pensize(2)alex.penup()alex.speed(0)wa...

1、先搞清楚画笔的基本用法。 2、再搞清楚椭圆的函数。 3、根据别人的代码,自己多调试几次就画出有意思的图形了。 代码如下: import turtlepen=turtle.Turtle() #定义画笔实例a=1for i in range(120): if 0

因为你的目录有一个叫turtle.py的文件,引入的时候并不是引入的系统的turtle模块,而是引入你的自己的这个文件,所以文件起名的时候注意不要和系统模块重名。

网站首页 | 网站地图
All rights reserved Powered by www.llgd.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com