Skip to content

Commit b85f0b4

Browse files
committed
fix indentation issues
1 parent 2f8d51b commit b85f0b4

1 file changed

Lines changed: 22 additions & 26 deletions

File tree

pretext/Lists/TheAccumulatorPatternwithLists.ptx

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<input>
1414
sum = 0
1515
for num in [1, 3, 5, 7, 9]:
16-
sum = sum + num
16+
sum = sum + num
1717
print(sum)
1818
</input>
1919
</program>
@@ -33,8 +33,8 @@
3333
<input>
3434
long_names = 0
3535
for name in ["Joe", "Sally", "Amy", "Brad"]:
36-
if len(name) &gt; 3:
37-
long_names += 1
36+
if len(name) &gt; 3:
37+
long_names += 1
3838
print(long_names)
3939
</input>
4040
</program>
@@ -51,8 +51,8 @@
5151
s = "what if we went to the zoo"
5252
num_vowels = 0
5353
for i in s:
54-
if i in ['a', 'e', 'i', 'o', 'u']:
55-
num_vowels += 1
54+
if i in ['a', 'e', 'i', 'o', 'u']:
55+
num_vowels += 1
5656
print(num_vowels)
5757
</input>
5858
</program>
@@ -79,8 +79,8 @@
7979
nums = [9, 3, 8, 11, 5, 29, 2]
8080
best_num = 0
8181
for n in nums:
82-
if n &gt; best_num:
83-
best_num = n
82+
if n &gt; best_num:
83+
best_num = n
8484
print(best_num)
8585
</input>
8686
</program>
@@ -98,8 +98,8 @@
9898
nums = [9, 3, 8, 11, 5, 29, 2]
9999
best_num = nums[0]
100100
for n in nums:
101-
if n &gt; best_num:
102-
best_num = n
101+
if n &gt; best_num:
102+
best_num = n
103103
print(best_num)
104104
</input>
105105
</program>
@@ -115,7 +115,7 @@
115115
scores = [85, 95, 70]
116116
result = ''
117117
for score in scores:
118-
result = result + str(score) + ','
118+
result = result + str(score) + ','
119119

120120
print("The scores are " + result)
121121
</input>
@@ -139,7 +139,7 @@
139139
scores = [85, 95, 70]
140140
result = ''
141141
for score in scores:
142-
result = result + str(score) + ','
142+
result = result + str(score) + ','
143143

144144
print("The scores are " + result)
145145

@@ -149,9 +149,8 @@
149149

150150
class myTests(TestCaseGui):
151151

152-
def testOne(self):
153-
self.assertEqual(self.getOutput().rstrip('\n'), 'The scores are 85, 95, and 70.', "Output
154-
should be 'The scores are 85, 95, and 70.'")
152+
def testOne(self):
153+
self.assertEqual(self.getOutput().rstrip('\n'), 'The scores are 85, 95, and 70.', "Output should be 'The scores are 85, 95, and 70.'")
155154

156155
myTests().main()
157156
</input>
@@ -167,7 +166,7 @@
167166
scores = [85, 95, 70]
168167
result = ''
169168
for score in scores[:-1]:
170-
result = result + str(score) + ', '
169+
result = result + str(score) + ', '
171170

172171
# Now, append the last score
173172
result = result + 'and ' + str(scores[-1]) + '.'
@@ -194,8 +193,8 @@
194193
s = "We are learning!"
195194
x = 0
196195
for i in s:
197-
if i in ['a', 'b', 'c', 'd', 'e']:
198-
x += 1
196+
if i in ['a', 'b', 'c', 'd', 'e']:
197+
x += 1
199198
print(x)
200199
</input>
201200
</program>
@@ -253,8 +252,8 @@
253252
list= [5, 2, 1, 4, 9, 10]
254253
min_value = 0
255254
for item in list:
256-
if item &lt; min_value:
257-
min_value = item
255+
if item &lt; min_value:
256+
min_value = item
258257
print(min_value)
259258
</input>
260259
</program>
@@ -319,13 +318,10 @@
319318

320319
class myTests(TestCaseGui):
321320

322-
def testNine(self):
323-
self.assertEqual(past_tense, ['adopted', 'baked', 'beamed', 'confided', 'grilled',
324-
'planted', 'timed', 'waved', 'wished'], "Testing that the past_tense list is correct.")
325-
self.assertIn("else", self.getEditorText(), "Testing output (Don't worry about actual and
326-
expected values).")
327-
self.assertIn("for", self.getEditorText(), "Testing output (Don't worry about actual and
328-
expected values).")
321+
def testNine(self):
322+
self.assertEqual(past_tense, ['adopted', 'baked', 'beamed', 'confided', 'grilled', 'planted', 'timed', 'waved', 'wished'], "Testing that the past_tense list is correct.")
323+
self.assertIn("else", self.getEditorText(), "Testing output (Don't worry about actual and expected values).")
324+
self.assertIn("for", self.getEditorText(), "Testing output (Don't worry about actual and expected values).")
329325

330326
myTests().main()
331327
</input>

0 commit comments

Comments
 (0)