Python自學 第四課 Python3畫方形

in #python5 years ago

1. import 引用一個寫好的程式

import turtle                  turtle是一個已經寫好的畫畫的程式,此處是直接引用

my_turtle=turtle.Turtle()           my_turtle在這句話以後就有了畫畫的功能

my_turtle.shape("turtle")

my_turtle.forward(100)             my_turtle向前走100步

my_turtle.right(90)                     my_turtle右轉90度
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
my_turtle.right(90)
my_turtle.forward(100)
turtle.mainloop()                       



Sort:  

Congratulations @luciole-saison! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You published your First Post
You got a First Vote
You received more than 10 upvotes. Your next target is to reach 50 upvotes.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.26
TRX 0.12
JST 0.031
BTC 61258.08
ETH 2873.80
USDT 1.00
SBD 3.56