diff options
author | raylu <raylu@cmu.edu> | 2011-05-13 18:47:47 -0400 |
---|---|---|
committer | raylu <raylu@cmu.edu> | 2011-05-13 18:47:47 -0400 |
commit | f3f08c48355026ad43b17e1ff3b57fe24cd5e97c (patch) | |
tree | f8cab7f5bb408772fbe160d0780a4260bf9d07a7 /static/lab2.py | |
parent | a9d64c77d9964c1dbeaa1dd1a7eb90c1b64d72e4 (diff) | |
download | pyc-f3f08c48355026ad43b17e1ff3b57fe24cd5e97c.tar.xz |
Convert starter code to soft tabs
Diffstat (limited to 'static/lab2.py')
-rw-r--r-- | static/lab2.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/static/lab2.py b/static/lab2.py index a7dd654..7fa8840 100644 --- a/static/lab2.py +++ b/static/lab2.py @@ -5,28 +5,28 @@ # total should return the sum of the numbers passed in def total(numbers): - return numbers[0] + return numbers[0] # onestring should return 1 the first time it's called and 'ring' the second time def onestring(): - return 1 + return 1 # Your code will be run in a sandbox, so print statements are not allowed in # the required functions. The below code gets executed when you run the python # file; this should aid you in debugging/testing. if __name__ == '__main__': - list1 = [1, 2, 3] - list2 = [-10, -10, -30] - print 'sum of list1:', total(list1) - print 'sum of list2:', total(list2) + list1 = [1, 2, 3] + list2 = [-10, -10, -30] + print 'sum of list1:', total(list1) + print 'sum of list2:', total(list2) - print # blank line + print # blank line - if onestring() == 1: - print 'got 1 the first time!' - else: - print 'onestring didn\'t return 1 the first time :(' - if onestring() == 'ring': - print "got 'ring' the second time!" - else: - print "onestring didn't print 'ring' the second time D:" + if onestring() == 1: + print 'got 1 the first time!' + else: + print 'onestring didn\'t return 1 the first time :(' + if onestring() == 'ring': + print "got 'ring' the second time!" + else: + print "onestring didn't print 'ring' the second time D:" |