欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

python 利用turtle庫繪制笑臉和哭臉的例子

 更新時間:2019年11月23日 09:51:02   作者:yiweiyi329  
今天小編就為大家分享一篇python 利用turtle庫繪制笑臉和哭臉的例子,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

我就廢話不多說了,直接上代碼吧!

import turtle
turtle.pensize(5)
turtle.pencolor("yellow")
turtle.fillcolor("red")
turtle.penup()
turtle.goto(0,-200)
turtle.pendown()
turtle.circle(200)
 
turtle.penup()
turtle.goto(-100,50)
turtle.pendown()
turtle.begin_fill()
turtle.circle(17.5)
turtle.end_fill()
 
turtle.penup()
turtle.goto(100,50)
turtle.pendown()
turtle.begin_fill()
turtle.circle(17.5)
turtle.end_fill()
 
turtle.penup()
turtle.goto(0,50)
turtle.pendown()
turtle.circle(-70,steps=3)
 
turtle.penup()
turtle.goto(-100,-70)
turtle.pendown()
turtle.right(90)
turtle.circle(100,180)
turtle.mainloop()#結(jié)果如下

import turtle
turtle.pensize(5)
turtle.pencolor("green")
turtle.fillcolor("red")
turtle.penup()
turtle.goto(0,-200)
turtle.pendown()
turtle.circle(200)
 
turtle.penup()
turtle.goto(-100,50)
turtle.pendown()
turtle.begin_fill()
turtle.circle(17.5)
turtle.end_fill()
 
turtle.penup()
turtle.goto(100,50)
turtle.pendown()
turtle.begin_fill()
turtle.circle(17.5)
turtle.end_fill()
 
turtle.penup()
turtle.goto(0,50)
turtle.pendown()
turtle.circle(-70,steps=3)
 
turtle.penup()
turtle.goto(-50,-120)
turtle.pendown()
turtle.left(90)
turtle.circle(-50,180)
 
turtle.mainloop()#結(jié)果如下

import turtle
turtle.pensize(5)
turtle.pencolor("green")
turtle.fillcolor("red")
turtle.penup()
turtle.goto(0,-200)
turtle.pendown()
turtle.circle(200)
 
turtle.penup()
turtle.goto(-100,50)
turtle.pendown()
turtle.begin_fill()
turtle.circle(17.5)
turtle.end_fill()
 
turtle.penup()
turtle.goto(100,50)
turtle.pendown()
turtle.begin_fill()
turtle.circle(17.5)
turtle.end_fill()
 
turtle.penup()
turtle.goto(0,50)
turtle.pendown()
turtle.circle(-70,steps=3)
 
turtle.penup()
 
turtle.goto(-100,-120)
turtle.pendown()
 
turtle.left(90)
turtle.circle(-25,180)
 
turtle.left(180)
turtle.circle(-25,180)
 
turtle.left(180)
turtle.circle(-25,180)
 
turtle.left(180)
turtle.circle(-25,180)
 
turtle.mainloop()#結(jié)果如下

以上這篇python 利用turtle庫繪制笑臉和哭臉的例子就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • Python 3實戰(zhàn)爬蟲之爬取京東圖書的圖片詳解

    Python 3實戰(zhàn)爬蟲之爬取京東圖書的圖片詳解

    最近在學(xué)習(xí)python3,下面這篇文章主要給大家介紹了關(guān)于Python3實戰(zhàn)爬蟲之爬取京東圖書圖片的相關(guān)資料,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起看看吧。
    2017-10-10
  • django rest framework 數(shù)據(jù)的查找、過濾、排序的示例

    django rest framework 數(shù)據(jù)的查找、過濾、排序的示例

    這篇文章主要介紹了 django rest framework 數(shù)據(jù)的查找、過濾、排序,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-06-06
  • python處理圓角圖片、圓形圖片的例子

    python處理圓角圖片、圓形圖片的例子

    最近因為工作需要,需要處理圖片,一種是頭像的方形圖片處理成圓行的,一種是方形圖片的4角變得橢圓點
    2014-04-04
  • Python中的八大核心語句你知道幾個呢?

    Python中的八大核心語句你知道幾個呢?

    Python?是一種代表簡單思想的語言,其語法相對簡單,很容易上手。本文精心篩選了Python中的八大核心語句,快來看看你都掌握了幾個呢
    2023-02-02
  • Python中datetime模塊參考手冊

    Python中datetime模塊參考手冊

    Python處理時間和日期方面的模塊,主要就是datetime、time、calendar三個模塊的使用。下面這篇文章主要給大家介紹的是Python中的datetime模塊,需要的朋友可以參考借鑒,下面來一起看看吧。
    2017-01-01
  • 詳解Django框架中用戶的登錄和退出的實現(xiàn)

    詳解Django框架中用戶的登錄和退出的實現(xiàn)

    這篇文章主要介紹了詳解Django框架中用戶的登錄和退出的實現(xiàn),Django是重多Python人氣框架中最為知名的一個,需要的朋友可以參考下
    2015-07-07
  • Ubuntu16安裝CUDA(9.1)和cuDNN的實現(xiàn)步驟(圖文)

    Ubuntu16安裝CUDA(9.1)和cuDNN的實現(xiàn)步驟(圖文)

    本文主要介紹了Ubuntu16安裝CUDA(9.1)和cuDNN,文中通過圖文介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-07-07
  • 聊聊python中的循環(huán)遍歷

    聊聊python中的循環(huán)遍歷

    這篇文章主要介紹了python中的循環(huán)遍歷的相關(guān)資料,幫助大家更好的理解和學(xué)習(xí)python,感興趣的朋友可以了解下
    2020-09-09
  • Python3.4學(xué)習(xí)筆記之類型判斷,異常處理,終止程序操作小結(jié)

    Python3.4學(xué)習(xí)筆記之類型判斷,異常處理,終止程序操作小結(jié)

    這篇文章主要介紹了Python3.4學(xué)習(xí)筆記之類型判斷,異常處理,終止程序操作,結(jié)合具體實例形式分析了Python3.4模塊導(dǎo)入、異常處理、退出程序等相關(guān)操作技巧與注意事項,需要的朋友可以參考下
    2019-03-03
  • Python3 jupyter notebook 服務(wù)器搭建過程

    Python3 jupyter notebook 服務(wù)器搭建過程

    這篇文章主要介紹了Python3 jupyter notebook 服務(wù)器搭建過程,非常不錯,具有一定的參考借鑒價值,需要的朋友參考下吧
    2018-11-11

最新評論