i have the following simple function that iterates over the list. It passes
the list item into the function and adds the numbers. What would be the
equivalent way of writing the "map" portion with list comprehension? My
code is as follows:

def add(number):
    print 1 + int(number)



x = ['2', '4', '6', '8', '10', '12']

map(add, x)

thanks for the help and thank you for this mailing list.

AngryNinja
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to