Merge lp:~pyotago/practical-programming/iain into lp:practical-programming

Proposed by Iain Hewson
Status: Merged
Merged at revision: 45
Proposed branch: lp:~pyotago/practical-programming/iain
Merge into: lp:practical-programming
Diff against target: 47 lines (+7/-12)
1 file modified
source/mastery_1_3.py (+7/-12)
To merge this branch: bzr merge lp:~pyotago/practical-programming/iain
Reviewer Review Type Date Requested Status
Brendan McCane Approve
Review via email: mp+99460@code.launchpad.net

Description of the change

Removed new list requirements from mastery_1_3 questions

To post a comment you must log in.
Revision history for this message
Brendan McCane (mccane) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'source/mastery_1_3.py'
--- source/mastery_1_3.py 2012-02-16 03:31:22 +0000
+++ source/mastery_1_3.py 2012-03-27 02:40:58 +0000
@@ -36,36 +36,31 @@
36 36
37def sortstuff(mylist):37def sortstuff(mylist):
38 """38 """
39 Return a new list that is a sorted version of the parameter39 Return a sorted version of the parameter mylist.
40 mylist. The original list should remain unaltered.
4140
42 >>> sortstuff([3, 5, 1, 9, 13, 2])41 >>> sortstuff([3, 5, 1, 9, 13, 2])
43 [1, 2, 3, 5, 9, 13]42 [1, 2, 3, 5, 9, 13]
44 >>> sortstuff(["one", "two", "three", "four"])43 >>> sortstuff(["one", "two", "three", "four"])
45 ['four', 'one', 'three', 'two']44 ['four', 'one', 'three', 'two']
46 >>> list1 = [2, 4, 1, 7, 0]
47 >>> list2 = sortstuff(list1)
48 >>> list1==list2
49 False
50 """45 """
5146
5247
5348
5449
5550
51
52
53
54
55
56def sortstuff_reverse(mylist):56def sortstuff_reverse(mylist):
57 """57 """
58 Return a new list that is a reverse sorted version of the58 Return a reverse sorted version of the parameter mylist.
59 parameter mylist. The original list should remain unaltered.
6059
61 >>> sortstuff_reverse([3, 5, 1, 9, 13, 2])60 >>> sortstuff_reverse([3, 5, 1, 9, 13, 2])
62 [13, 9, 5, 3, 2, 1]61 [13, 9, 5, 3, 2, 1]
63 >>> sortstuff_reverse(["one", "two", "three", "four"])62 >>> sortstuff_reverse(["one", "two", "three", "four"])
64 ['two', 'three', 'one', 'four']63 ['two', 'three', 'one', 'four']
65 >>> list1 = [2, 4, 1, 7, 0]
66 >>> list2 = sortstuff_reverse(list1)
67 >>> list1==list2
68 False
69 """64 """
7065
71if __name__ == "__main__":66if __name__ == "__main__":

Subscribers

People subscribed via source and target branches

to all changes: