-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathturtle_notes_starter.py
More file actions
57 lines (37 loc) · 1.58 KB
/
turtle_notes_starter.py
File metadata and controls
57 lines (37 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# unit 3 notes - turtles & indexing
# turtle objects and methods
# indexing a sequence
import turtle
# INDEX VALUE - selects an item from a sequence, such as a character from a string, or an element from a tuple.
# use square bracket [] to select an item by index value
"""
0 1 2 3 4 5
string = " T U R T L E "
-6 -5 -4 -3 -2 -1
"""
string = "TURTLE"
print("T:")
print("U:")
print("R:")
print("T:")
print("L:")
print("E:")
names = ("Leonardo", "Raphael", "Michelangelo", "Donatello")
colors = ("blue", "red", "orange", "purple")
# CHALLENGE: print "Leonardo is the color blue" using indexing
# accessing index values within an loop
# Object Oriented Programming (OOP) refresher
# OBJECT - a software model that bundles data and behavior together; useful for modeling real-world objects, like turtles!
# METHOD - behaviors, or actions, of a software object
# RECALL: Think of and write down below one example of an object in Alice.
# Write down two examples of methods for this object.
# e.g. in Alice a < > was an object and its methods included < >
# e.g. in Python a < > is an object and its methods include < >
# create Leonardo
# I didn't write the code for a Turtle. How do I know how to use it?
# create Michelangelo
# INDIVIDUAL CHALLENGE: create Raphael & Donatello and draw 2 more squares
# create Raphael
# create Donatello
# moving a turtle
# PARTNER CHALLENGE: use a for loop to draw a square with Leo