-
Notifications
You must be signed in to change notification settings - Fork 0
/
hw6.py
103 lines (78 loc) · 1.96 KB
/
hw6.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Name: Chris Edwards, Sam Goldsmith
# Evergreen Login: edwchr30, golsam27
# Computer Science Foundations
# Programming as a Way of Life
# Homework 6
# You may do your work by editing this file, or by typing code at the
# command line and copying it into the appropriate part of this file when
# you are done. When you are done, running this file should compute and
# print the answers to all the problems.
###
### Problem 3
###
# DO NOT CHANGE THE FOLLOWING LINE
print "Problem 3 solution follows:"
rounded_height = {}
rounded_height = ["John"] = 6
rounded_height = ["Mike"] = 5
rounded_height = ["Nate"] = 6
rounded_height = ["Harry"] = 7
###
### Problem 4
###
# DO NOT CHANGE THE FOLLOWING LINE
print "Problem 4 solution follows:"
print rounded_height['Nate']
rounded_height = ["Terry"] = 8
###
### Problem 5
###
# DO NOT CHANGE THE FOLLOWING LINE
print "Problem 5 solution follows:"
# ... write your code and comments here (and remove this line)
###
### Problem 6
###
# DO NOT CHANGE THE FOLLOWING LINE
print "Problem 6 solution follows:"
x = 0
n = 5
while x < n:
x += 1
print (x)
//////////////////////////////
n = range(1,11)
for count in n:
print (count)
//////////////////////////////
x = 0
for N in range(1,11):
x = x + 1
print (x)
###
### Problem 7
###
# DO NOT CHANGE THE FOLLOWING LINE
print "Problem 7 solution follows:"
y = 10
q = 0
while(q < y):
print "iteration counter"
q = q + 1
In [29]: %run "c:\users\sam\appdata\local\temp\tmpujanur.py"
iteration counter
iteration counter
iteration counter
iteration counter
iteration counter
iteration counter
iteration counter
iteration counter
iteration counter
iteration counter
### i got a bit confused in exactly you wanted me to do so i did this. hope this was right but i dont think so
###
### Collaboration
###
# ... List your collaborators and other sources of help here (websites, books, etc.),
# ... as a comment (on a line starting with "#").