python 利用turtle庫(kù)繪制笑臉和哭臉的例子
我就廢話不多說(shuō)了,直接上代碼吧!
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庫(kù)繪制笑臉和哭臉的例子就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
Python 3實(shí)戰(zhàn)爬蟲(chóng)之爬取京東圖書(shū)的圖片詳解
最近在學(xué)習(xí)python3,下面這篇文章主要給大家介紹了關(guān)于Python3實(shí)戰(zhàn)爬蟲(chóng)之爬取京東圖書(shū)圖片的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來(lái)一起看看吧。2017-10-10django rest framework 數(shù)據(jù)的查找、過(guò)濾、排序的示例
這篇文章主要介紹了 django rest framework 數(shù)據(jù)的查找、過(guò)濾、排序,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-06-06詳解Django框架中用戶的登錄和退出的實(shí)現(xiàn)
這篇文章主要介紹了詳解Django框架中用戶的登錄和退出的實(shí)現(xiàn),Django是重多Python人氣框架中最為知名的一個(gè),需要的朋友可以參考下2015-07-07Ubuntu16安裝CUDA(9.1)和cuDNN的實(shí)現(xiàn)步驟(圖文)
本文主要介紹了Ubuntu16安裝CUDA(9.1)和cuDNN,文中通過(guò)圖文介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2021-07-07Python3.4學(xué)習(xí)筆記之類型判斷,異常處理,終止程序操作小結(jié)
這篇文章主要介紹了Python3.4學(xué)習(xí)筆記之類型判斷,異常處理,終止程序操作,結(jié)合具體實(shí)例形式分析了Python3.4模塊導(dǎo)入、異常處理、退出程序等相關(guān)操作技巧與注意事項(xiàng),需要的朋友可以參考下2019-03-03Python3 jupyter notebook 服務(wù)器搭建過(guò)程
這篇文章主要介紹了Python3 jupyter notebook 服務(wù)器搭建過(guò)程,非常不錯(cuò),具有一定的參考借鑒價(jià)值,需要的朋友參考下吧2018-11-11