The first two only require one liners of logic, so here:
n = int(raw_input("How many squares? "))
squares = [x*x for x in range(1,n+1)]
print square
def even_only(argList):
return filter(lambda m: m%2==0, argList)
As for the pig latin, you'll need to break the sentence down into words with split, do something to each word that will make it pig latin, then remake the sentence with join.
For homework problems please give help in the form of hints, not total solutions or the OP will not learn anything.
Reputation Points: 1333
Solved Threads: 1404
DaniWeb's Hypocrite
Offline 5,792 posts
since Oct 2004