#彩色螺旋线

import turtle
import time turtle.pensize(2)
turtle.bgcolor("black")
colors = ["red", "yellow",'purple','blue'] turtle.tracer(False) for x in range(400):
turtle.forward(2*x)
turtle.color(colors[x % 4])
turtle.left(91) turtle.tracer(True) turtle.done()

吴裕雄--天生自然python编程:turtle模块绘图(2)的更多相关文章

  1. 吴裕雄--天生自然python编程:正则表达式

    re.match函数 re.match 尝试从字符串的起始位置匹配一个模式,如果不是起始位置匹配成功的话,match()就返回none. 函数语法: re.match(pattern, string, ...

  2. 吴裕雄--天生自然python编程:turtle模块绘图(3)

    turtle(海龟)是Python重要的标准库之一,它能够进行基本的图形绘制.turtle图形绘制的概念诞生于1969年,成功应用于LOGO编程语言. turtle库绘制图形有一个基本框架:一个小海龟 ...

  3. 吴裕雄--天生自然python编程:turtle模块绘图(1)

    Turtle库是Python语言中一个很流行的绘制图像的函数库,想象一个小乌龟,在一个横轴为x.纵轴为y的坐标系原点,(0,0)位置开始,它根据一组函数指令的控制,在这个平面坐标系中移动,从而在它爬行 ...

  4. 吴裕雄--天生自然python编程:turtle模块绘图(4)

    import turtle bob = turtle.Turtle() for i in range(1,5): bob.fd(100) bob.lt(90) turtle.mainloop() im ...

  5. 吴裕雄--天生自然python编程:实例(1)

    str = "www.runoob.com" print(str.upper()) # 把所有字符中的小写字母转换成大写字母 print(str.lower()) # 把所有字符中 ...

  6. 吴裕雄--天生自然python编程:实例

    # 该实例输出 Hello World! print('Hello World!') # 用户输入数字 num1 = input('输入第一个数字:') num2 = input('输入第二个数字:' ...

  7. 吴裕雄--天生自然python编程:pycharm常用快捷键问题

    最近在使用pycharm的时候发现不能正常使用ctrl+c/v进行复制粘贴,也无法使用tab键对大段代码进行整体缩进.后来发现是因为安装了vim插件的问题,在setting里找到vim插件,取消勾选即 ...

  8. 吴裕雄--天生自然python编程:实例(3)

    # 返回 x 在 arr 中的索引,如果不存在返回 -1 def binarySearch (arr, l, r, x): # 基本判断 if r >= l: mid = int(l + (r ...

  9. 吴裕雄--天生自然python编程:实例(2)

    list1 = [10, 20, 4, 45, 99] list1.sort() print("最小元素为:", *list1[:1]) list1 = [10, 20, 1, 4 ...

随机推荐

  1. 开启新项目时启动tomcat的一个小问题

    Application context 这里为啥只有是空的,才能正常启动tomcat?

  2. 【按位dp】1出现的次数

    l-r1出现的次数 注意端点处理 垃圾算法书 垃圾代码毁我青春 自己研究写了写 #include <iostream> #include <string> #include & ...

  3. diverta 2019 Programming Contest 2自闭记

    A 签到(a-b problem不用贴了吧,以后atcoder小于300分题均不贴代码) B 发现选择的p,q一定是其中两点间的距离,于是可以O(n2)枚举两点,再O(n2)判断,其实可以做到O(n3 ...

  4. Notification通知在OPPO手机上不弹出提示?

    oppo默认应用 不允许通知. 解决步骤:设置 通知与状态栏 通知管理 NotificationTest 允许通知

  5. gcc -c xx.c 选项讲解

    -c选项表示编译.汇编指定的源文件(也就是编译源文件),但是不进行链接.使用-c选项可以将每一个源文件编译成对应的目标文件. 目标文件是一种中间文件或者临时文件,如果不设置该选项,gcc 一般不会保留 ...

  6. [Algo] 649. String Replace (basic)

    Given an original string input, and two strings S and T, replace all occurrences of S in input with ...

  7. set theory

    set theory Apart from classical logic, we assume the usual informal concept of sets. The reader (onl ...

  8. 关于目录的操作|*|<>|opendir |readdir|unlink|find2perl|rename|readlink|oct()|utime

    #!/usr/bin/perl use strict; use warnings; foreach my $arg(@ARGV) { print "one is $arg\n"; ...

  9. javascript 的七种基本数据类型

    六种基本数据类型 undefined null string boolean number symbol(ES6) 一种引用类型 Object 为什么要引入 Symbol? ES5的对象中的属性名是字 ...

  10. spring boot GlobalExceptionHandler @RestControllerAdvice @ExceptionHandler

    package me.zhengjie.common.exception.handler; import lombok.extern.slf4j.Slf4j; import me.zhengjie.c ...