Google Colab と Turtle で描くアルファベット一覧（小文字編）

# 0. はじめに

- [MYJLab Advent Calendar 2021](https://qiita.com/advent-calendar/2021/myjlab) 16日目の記事です．
    - 昨日は@Tyanri_氏の『[PyCaret使ってみる](https://qiita.com/Tyanri_/items/9559e18faa3cd19d7788)』でした．数行のコードでデータの前処理から様々な機械学習手法の精度比較までしてくれるライブラリのPyCaretを紹介してくれました．
- [Google Colab と Turtle で描くアルファベット一覧（大文字編）](https://qiita.com/chiba___/items/fae8271cad6b9d2604fd)の続きです．
    - Google Colaboratory と Turtle（タートルグラフィックス）でのアルファベットの描き方をまとめました．
    - Turtleに命令を出して動かすことで簡単に文字を描くことができます．


# 1. Turtle で描くアルファベット小文字一覧

- 一画目：<font color="red">赤色</font>
- 二画目：<font color="blue">青色</font>
- 三画目：<font color="yellow">黄色</font>
- 四画目：<font color="green">緑色</font>

## a
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/3f60e856-f97d-073b-080e-a01f66ab3fa3.gif" width="300px">

```Python:a.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(40)

# 一画目
turtle.pendown()
turtle.pencolor("red")
for i in range(27):
    turtle.left(10)
    turtle.forward(5)
turtle.penup()

# 一画目→二画目準備
turtle.right(130)
turtle.backward(50)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(60)
turtle.penup()

turtle.hideturtle()
```


## b
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/833be28a-c770-320c-4358-47f20efb71ad.gif" width="300px">

```Python:b.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(180)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(90)
turtle.penup()

# 一画目→二画目準備
turtle.backward(45)
turtle.left(130)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
for i in range(25):
    turtle.right(10)
    turtle.forward(5)
turtle.penup()

turtle.hideturtle()
```


## c
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/30da8887-518c-d621-45ba-12b157a04b35.gif" width="300px">

```Python:c.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(40)

# 一画目
turtle.pendown()
turtle.pencolor("red")
for i in range(28):
    turtle.left(10)
    turtle.forward(6)
turtle.penup()

turtle.hideturtle()
```
## d
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/9b6b97e8-0edf-f869-2df3-0fdbfb8e45d4.gif" width="300px">

```Python:d.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(180)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(90)
turtle.penup()

# 一画目→二画目準備
turtle.backward(45)
turtle.right(130)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
for i in range(25):
    turtle.left(10)
    turtle.forward(5)
turtle.penup()

turtle.hideturtle()
```

## e
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/a65029f4-31c3-3aaa-100e-e18087e33ff5.gif" width="300px">

```Python:e.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.right(90)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(50)
turtle.penup()

# 一画目→二画目準備
turtle.left(100)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
for i in range(32):
    turtle.left(10)
    turtle.forward(5)
turtle.penup()

turtle.hideturtle()
```

## f
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/6d4b557b-a703-a303-6fed-e0af4335cddb.gif" width="300px">

```Python:f.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(20)

# 一画目
turtle.pendown()
turtle.pencolor("red")
for i in range(8):
    turtle.left(20)
    turtle.forward(5)
turtle.forward(75)
turtle.penup()

# 一画目→二画目準備
turtle.backward(60)
turtle.right(90)
turtle.backward(20)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(40)
turtle.penup()

turtle.hideturtle()
```

## g
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/dc641a66-24ac-004f-1630-f011d60a1a4e.gif" width="300px">


```Python:g.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(40)

# 一画目
turtle.pendown()
turtle.pencolor("red")
for i in range(28):
    turtle.left(10)
    turtle.forward(4)
turtle.penup()

# 一画目→二画目準備
turtle.right(140)
turtle.backward(40)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(70)
for i in range(14):
    turtle.right(10)
    turtle.forward(4)
turtle.penup()

turtle.hideturtle()
```

## h
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/dedbd2bd-f208-7de1-1149-10b9bcc066a0.gif" width="300px">

```Python:h.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(180)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(90)
turtle.penup()

# 一画目→二画目準備
turtle.left(180)


# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(45)
turtle.right(30)
for i in range(11):
    turtle.right(10)
    turtle.forward(5)
turtle.right(40)
turtle.forward(45)
turtle.penup()

turtle.hideturtle()
```

## i
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/6cc7f836-47e9-a73a-7288-46f5b3a4160f.gif" width="300px">

```Python:i.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=5)

# 一画目準備
turtle.left(180)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(50)
turtle.penup()

# 一画目→二画目準備
turtle.backward(70)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(10)
turtle.penup()

turtle.hideturtle()
```

## j
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/afb03d40-4712-c0a5-861e-e04d8a428db1.gif" width="300px">

```Python:j.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(180)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(50)
for i in range(12):
    turtle.right(15)
    turtle.forward(5)
turtle.penup()

# 一画目→二画目準備
turtle.forward(65)
turtle.right(90)
turtle.forward(38)
turtle.right(90)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(10)
turtle.penup()

turtle.hideturtle()
```

## k
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/e0fa9ddf-7aff-e1d2-628d-3999b9f80055.gif" width="300px">

```Python:k.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=5)

# 一画目準備
turtle.left(180)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(90)
turtle.penup()

# 一画目→二画目準備
turtle.backward(30)
turtle.right(45)
turtle.backward(45)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(45)
turtle.penup()

# 二画目→三画目準備
turtle.left(90)

# 三画目
turtle.pendown()
turtle.pencolor("yellow")
turtle.forward(45)
turtle.penup()

turtle.hideturtle()
```
## l
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/d4f0d72c-bbb3-8484-433b-501d08800f0c.gif" width="300px">

```Python:l.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=5)

# 一画目準備
turtle.left(180)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(90)
turtle.penup()

turtle.hideturtle()
```

## m
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/ca25bc33-7659-7054-3382-d70ab2a337b2.gif" width="300px">

```Python:m.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(180)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(60)
turtle.penup()

# 一画目→二画目準備
turtle.left(180)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(45)
turtle.right(30)
for i in range(11):
    turtle.right(10)
    turtle.forward(5)
turtle.right(40)
turtle.forward(45)
turtle.penup()

# 二画目→三画目準備
turtle.left(180)

# 三画目
turtle.pendown()
turtle.pencolor("yellow")
turtle.forward(45)
turtle.right(30)
for i in range(11):
    turtle.right(10)
    turtle.forward(5)
turtle.right(40)
turtle.forward(45)
turtle.penup()

turtle.hideturtle()
```

## n
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/d5875065-0975-2142-a8fe-bd0330d7d458.gif" width="300px">

```Python:n.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(180)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(60)
turtle.penup()

# 一画目→二画目準備
turtle.left(180)


# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(45)
turtle.right(30)
for i in range(11):
    turtle.right(10)
    turtle.forward(5)
turtle.right(40)
turtle.forward(45)
turtle.penup()

turtle.hideturtle()
```

## o
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/8df359c9-563d-6f59-eb73-821c141f9001.gif" width="300px">

```Python:o.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(100)

# 一画目
turtle.pendown()
turtle.pencolor("red")
for i in range(7):
    turtle.left(10)
    turtle.forward(6)
turtle.setheading(90)
turtle.forward(20)
turtle.left(10)
for i in range(7):
    turtle.left(10)
    turtle.forward(6)
turtle.setheading(350)
for i in range(7):
    turtle.left(10)
    turtle.forward(6)
turtle.setheading(270)
turtle.forward(20)
turtle.left(10)
for i in range(7):
    turtle.left(10)
    turtle.forward(6)
turtle.penup()

turtle.hideturtle()
```

## p
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/49756a33-efa8-c359-6756-59afa86102de.gif" width="300px">

```Python:p.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(180)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(90)
turtle.penup()

# 一画目→二画目準備
turtle.backward(80)
turtle.left(145)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
for i in range(28):
    turtle.right(10)
    turtle.forward(5)
turtle.penup()

turtle.hideturtle()
```

## q
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/6fc8bb1d-38cb-3628-eedb-ca8d93f9ba0b.gif" width="300px">

```Python:q.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(35)

# 一画目
turtle.pendown()
turtle.pencolor("red")
for i in range(28):
    turtle.left(10)
    turtle.forward(5)
turtle.penup()

# 一画目→二画目準備
turtle.right(135)
turtle.backward(50)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(90)
turtle.penup()

turtle.hideturtle()
```

## r
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/d831d052-3d8d-5b39-718d-53fbf5c5ab8b.gif" width="300px">

```Python:r.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(180)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(60)
turtle.penup()

# 一画目→二画目準備
turtle.left(180)


# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(45)
turtle.right(30)
for i in range(6):
    turtle.right(10)
    turtle.forward(5)
turtle.penup()

turtle.hideturtle()
```

## s
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/3ca9f264-5c75-a97d-f11a-85445b542da3.gif" width="300px">

```Python:s.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(20)

# 一画目
turtle.pendown()
turtle.pencolor("red")
for i in range(14):
    turtle.left(10)
    turtle.forward(5)
turtle.left(20)
turtle.forward(10)
turtle.left(70)
turtle.forward(54)
turtle.right(70)
turtle.forward(10)
turtle.right(20)
for i in range(14):
    turtle.right(10)
    turtle.forward(5)
turtle.penup()

turtle.hideturtle()
```

## t
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/25f1f1a0-73d3-641b-afec-be69dd486632.gif" width="300px">

```Python:t.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=5)

# 一画目準備
turtle.left(180)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(75)
turtle.penup()

# 一画目→二画目準備
turtle.backward(60)
turtle.left(90)
turtle.backward(20)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(40)
turtle.penup()

turtle.hideturtle()
```

## u
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/aca9ec24-fa79-6c5b-a106-2a3d6fc61b7f.gif" width="300px">

```Python:u.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=8)

# 一画目準備
turtle.left(180)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(45)
turtle.left(30)
for i in range(11):
    turtle.left(10)
    turtle.forward(5)
turtle.left(40)
turtle.forward(45)
turtle.penup()

# 一画目→二画目準備
turtle.left(180)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(60)
turtle.penup()

turtle.hideturtle()
```

## v
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/6971f78d-a8a6-5da4-0786-c49ad59da97c.gif" width="300px">

```Python:v.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=5)

# 一画目準備
turtle.right(155)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(75)
turtle.penup()

# 一画目→二画目準備
turtle.right(50)
turtle.backward(75)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(75)
turtle.penup()

turtle.hideturtle()
```

## w
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/7bcd6aed-43f5-78bd-54c3-32ff35b208bf.gif" width="300px">

```Python:w.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=5)

# 一画目準備
turtle.right(160)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(75)
turtle.penup()

# 一画目→二画目準備
turtle.right(40)
turtle.backward(70)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(70)
turtle.penup()

# 二画目→三画目準備
turtle.backward(70)
turtle.left(40)

# 三画目
turtle.pendown()
turtle.pencolor("yellow")
turtle.forward(70)
turtle.penup()

# 三画目→四画目準備
turtle.right(40)
turtle.backward(75)

# 四画目
turtle.pendown()
turtle.pencolor("green")
turtle.forward(75)
turtle.penup()

turtle.hideturtle()
```

## x
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/fb3808bb-c188-a64e-5768-7e4aa0f1a41f.gif" width="300px">

```Python:x.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=5)

# 一画目準備
turtle.right(140)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(75)
turtle.penup()

# 一画目→二画目準備
turtle.right(40)
turtle.backward(58)
turtle.right(40)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(75)
turtle.penup()

turtle.hideturtle()
```

## y
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/0e0397ee-57a7-bbc9-5b25-486353cc185c.gif" width="300px">

```Python:y.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=5)

# 一画目準備
turtle.right(150)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(45)
turtle.penup()

# 一画目→二画目準備
turtle.right(60)
turtle.backward(45)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(85)
turtle.penup()

turtle.hideturtle()
```

## z
<img src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/484145/5806a314-4740-844b-b093-0eb717fe1f6a.gif" width="300px">

```Python:z.ipynb
initializeTurtle(initial_window_size=(300, 300), initial_speed=5)

# 一画目準備
turtle.right(90)

# 一画目
turtle.pendown()
turtle.pencolor("red")
turtle.forward(48)
turtle.penup()

# 一画目→二画目準備
turtle.right(125)

# 二画目
turtle.pendown()
turtle.pencolor("blue")
turtle.forward(75)
turtle.penup()

# 二画目→三画目準備
turtle.left(125)

# 三画目
turtle.pendown()
turtle.pencolor("yellow")
turtle.forward(48)
turtle.penup()

turtle.hideturtle()
```

# 2. おわりに
- 数字編もまとめたいと思います．
- Google Colab と Turtle で描くアルファベット一覧シリーズ
    - [大文字編](https://qiita.com/chiba___/items/fae8271cad6b9d2604fd)
    - [小文字編](https://qiita.com/chiba___/items/671de84c1ce47965effd)（本投稿）
    - 数字編（近日投稿予定）