Mater Dei Python Code
Sunday, March 9, 2014
List 13/18
n = [3, 5, 7]
def double_list(x):
for i in range(0, len(n)):
x[i] = x[i] * 2
# Don't forget to return your new list!
return x
print x
print double_list(x)
#note 'return' and other lines should line up under 'for'
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment