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
1=== modified file 'source/mastery_1_3.py'
2--- source/mastery_1_3.py 2012-02-16 03:31:22 +0000
3+++ source/mastery_1_3.py 2012-03-27 02:40:58 +0000
4@@ -36,36 +36,31 @@
5
6 def sortstuff(mylist):
7 """
8- Return a new list that is a sorted version of the parameter
9- mylist. The original list should remain unaltered.
10+ Return a sorted version of the parameter mylist.
11
12 >>> sortstuff([3, 5, 1, 9, 13, 2])
13 [1, 2, 3, 5, 9, 13]
14 >>> sortstuff(["one", "two", "three", "four"])
15 ['four', 'one', 'three', 'two']
16- >>> list1 = [2, 4, 1, 7, 0]
17- >>> list2 = sortstuff(list1)
18- >>> list1==list2
19- False
20 """
21
22
23
24
25
26+
27+
28+
29+
30+
31 def sortstuff_reverse(mylist):
32 """
33- Return a new list that is a reverse sorted version of the
34- parameter mylist. The original list should remain unaltered.
35+ Return a reverse sorted version of the parameter mylist.
36
37 >>> sortstuff_reverse([3, 5, 1, 9, 13, 2])
38 [13, 9, 5, 3, 2, 1]
39 >>> sortstuff_reverse(["one", "two", "three", "four"])
40 ['two', 'three', 'one', 'four']
41- >>> list1 = [2, 4, 1, 7, 0]
42- >>> list2 = sortstuff_reverse(list1)
43- >>> list1==list2
44- False
45 """
46
47 if __name__ == "__main__":

Subscribers

People subscribed via source and target branches

to all changes: