Quotes help make search much faster. Example: "Practice Makes Perfect"

Thursday, November 29, 2012

Codecademy: Using a list of lists in a function


#sample solution


n = [[1,2,3],[4,5,6,7,8,9]]
#function goes here
def myFun(singleListOfSublists):
concatenatedSubLists = []
for subList in singleListOfSublists:
for num in subList:
concatenatedSubLists.append(num)
return concatenatedSubLists

print myFun(n)

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts