Edit typos and grammar and add python files
This commit is contained in:
parent
c1222a8103
commit
991caf0521
16 changed files with 285 additions and 3 deletions
37
thinkcspy/Chapter-4-Exercises/Python-Files/problem10.py
Normal file
37
thinkcspy/Chapter-4-Exercises/Python-Files/problem10.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# Runestone.Academy thinkcspy course
|
||||
# Chapter 4
|
||||
# Problem 10
|
||||
|
||||
import turtle
|
||||
wn = turtle.Screen()
|
||||
|
||||
wn.bgcolor("lightgreen")
|
||||
|
||||
stella = turtle.Turtle()
|
||||
stella.color("blue")
|
||||
stella.shape("turtle")
|
||||
|
||||
avery = turtle.Turtle()
|
||||
avery.color("blue")
|
||||
|
||||
stella.up()
|
||||
avery.up()
|
||||
|
||||
stella.stamp()
|
||||
|
||||
for i in range(12):
|
||||
stella.forward(100)
|
||||
stella.stamp()
|
||||
|
||||
avery.forward(70)
|
||||
avery.down()
|
||||
avery.forward(10)
|
||||
avery.up()
|
||||
|
||||
stella.forward(-100)
|
||||
avery.forward(-80)
|
||||
|
||||
stella.right(30)
|
||||
avery.right(30)
|
||||
|
||||
wn.exitonclick()
|
||||
59
thinkcspy/Chapter-4-Exercises/Python-Files/problem11.py
Normal file
59
thinkcspy/Chapter-4-Exercises/Python-Files/problem11.py
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# Runestone.Academy thinkcspy course
|
||||
# Chapter 4
|
||||
# Problem 11
|
||||
|
||||
import turtle
|
||||
wn = turtle.Screen()
|
||||
|
||||
wn.bgcolor("black")
|
||||
|
||||
stella = turtle.Turtle()
|
||||
stella.color("lightblue")
|
||||
stella.speed(10)
|
||||
|
||||
avery = turtle.Turtle()
|
||||
avery.color("purple")
|
||||
avery.speed(10)
|
||||
avery.up()
|
||||
avery.right(90)
|
||||
avery.down()
|
||||
|
||||
missy = turtle.Turtle()
|
||||
missy.color("purple")
|
||||
missy.speed(10)
|
||||
missy.up()
|
||||
missy.left(90)
|
||||
missy.down()
|
||||
|
||||
dun = turtle.Turtle()
|
||||
dun.color("gold")
|
||||
dun.speed(10)
|
||||
dun.up()
|
||||
dun.left(90)
|
||||
dun.forward(30)
|
||||
dun.right(90)
|
||||
dun.down()
|
||||
|
||||
for i in range(8):
|
||||
stella.left(135)
|
||||
stella.forward(-120)
|
||||
|
||||
avery.right(45)
|
||||
avery.forward(-50)
|
||||
|
||||
for i in range(30, -32, -1):
|
||||
missy.forward(i)
|
||||
missy.left(20)
|
||||
|
||||
dun.forward(120)
|
||||
dun.left(120)
|
||||
dun.forward(70)
|
||||
for i in range(2):
|
||||
dun.left(120)
|
||||
dun.forward(30)
|
||||
dun.right(120)
|
||||
dun.forward(30)
|
||||
dun.left(120)
|
||||
dun.forward(70)
|
||||
|
||||
wn.exitonclick()
|
||||
9
thinkcspy/Chapter-4-Exercises/Python-Files/problem4.py
Normal file
9
thinkcspy/Chapter-4-Exercises/Python-Files/problem4.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Runestone.Academy thinkcspy course
|
||||
# Chapter 4
|
||||
# Problem 4
|
||||
|
||||
for i in [12, 10, 32, 3, 66, 17, 42, 99, 20]:
|
||||
print(i)
|
||||
|
||||
for i in [12, 10, 32, 3, 66, 17, 42, 99, 20]:
|
||||
print("The square of", i,"is", i**2)
|
||||
32
thinkcspy/Chapter-4-Exercises/Python-Files/problem5.py
Normal file
32
thinkcspy/Chapter-4-Exercises/Python-Files/problem5.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Runestone.Academy thinkcspy course
|
||||
# Chapter 4
|
||||
# Problem 5
|
||||
|
||||
import turtle
|
||||
wn = turtle.Screen()
|
||||
avery = turtle.Turtle()
|
||||
avery.color("blue")
|
||||
dun = turtle.Turtle()
|
||||
dun.color("pink")
|
||||
elliot = turtle.Turtle()
|
||||
elliot.color("lime")
|
||||
missy = turtle.Turtle()
|
||||
missy.color("yellow")
|
||||
|
||||
for i in range(3):
|
||||
avery.forward(50)
|
||||
avery.left(120)
|
||||
|
||||
for i in range(4):
|
||||
dun.backward(70)
|
||||
dun.left(90)
|
||||
|
||||
for i in range(6):
|
||||
elliot.left(60)
|
||||
elliot.forward(40)
|
||||
|
||||
for i in range(8):
|
||||
missy.right(45)
|
||||
missy.backward(80)
|
||||
|
||||
wn.exitonclick()
|
||||
19
thinkcspy/Chapter-4-Exercises/Python-Files/problem9.py
Normal file
19
thinkcspy/Chapter-4-Exercises/Python-Files/problem9.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# Runestone.Academy thinkcspy course
|
||||
# Chapter 4
|
||||
# Problem 9
|
||||
|
||||
import turtle
|
||||
wn = turtle.Screen()
|
||||
|
||||
stella = turtle.Turtle()
|
||||
stella.color("yellow")
|
||||
|
||||
stella.up()
|
||||
stella.forward(-50)
|
||||
stella.down()
|
||||
|
||||
for i in range(5):
|
||||
stella.left(144)
|
||||
stella.forward(-100)
|
||||
|
||||
wn.exitonclick()
|
||||
Loading…
Reference in a new issue