-
Notifications
You must be signed in to change notification settings - Fork 1
/
11 reading.py
49 lines (49 loc) · 938 Bytes
/
11 reading.py
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
# xs = [1, 2, 3, 4, 5]
# print(xs)
# for i in range(len(xs)):
# xs[i] = xs[i]**2
# # print(xs)
#
#
# for (i, val) in enumerate(xs):
# print(val, "this be i >", i)
# xs[i] = val**2
# print(xs)
#
#
# for (i, v) in enumerate(["banana", "apple", "pear", "lemon"]):
# print(i, v)
#
#
# def double_stuff(a_list):
# for (idx, val) in enumerate(a_list):
# a_list[idx] = val * 2
# return a_list
#
# things = [2, 5, 9]
# print(double_stuff(things))
#
#
# mylist = ["hi", "bye", "lie", "hi"]
# print(mylist.count("hi"))
#
# def double_stuff_2(a_list):
# new_list = []
# for value in a_list:
# new_elem = 2 * value
# new_list.append(new_elem)
# return new_list
#
# things = double_stuff_2(things)
# print(things)
# import turtle
# wn = turtle.Screen()
# tess = turtle.Turtle()
# alex = tess
# alex.color("hotpink")
#
# tess.lt(90)
# tess.fd(100)
# alex.lt(90)
# alex.fd(30)
# wn.mainloop()