forked from ernestas-poskus/interactive-programming-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloops_for.py
More file actions
49 lines (28 loc) · 773 Bytes
/
loops_for.py
File metadata and controls
49 lines (28 loc) · 773 Bytes
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
start_list = [5, 3, 1, 2, 4]
square_list = []
# Your code here!
for number in start_list:
n = number ** 2
square_list.append(n)
square_list.sort()
print square_list
webster = {
"Aardvark" : "A star of a popular children's cartoon show.",
"Baa" : "The sound a goat makes.",
"Carpet": "Goes on the floor.",
"Dab": "A small amount."
}
# Add your code below!
for k in webster:
print webster[k]
a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
for even in a:
if even % 2 == 0:
print even
# Write your function below!
def fizz_count(fizz_list):
count = 0
for item in fizz_list:
if item == 'fizz':
count += 1
return count