0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Python】turtleを使って☆星マークを記述

Last updated at Posted at 2021-12-16

Pythonとturtleと使って星マークを記述するコード。

実装コード1

from turtle import *

for i in range(10):
	forward(100)
	if i % 2 == 0: left(72)
	else: right(144)
done()

実行結果1

スクリーンショット 2021-12-16 19.45.11.png

*クロスさせないタイプの星型の図形です。

実装コード2

from turtle import *

for i in range(5):
	forward(100)
	right(144)
done()

実行結果2

スクリーンショット 2021-12-16 19.50.44.png

*クロスさせるタイプの星型の図形です。

Pythonのお役立ち情報

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?