On 12/14/2013 10:12 AM, Bo Morris wrote:
Thank you for your assistance. Based on your direction, I figured it out.
*This... *
def add(number):
print 1 + int(number)
x = ['2', '4', '6', '8', '10', '12']
[add(item) for item in x]
*Is the same as... *
def add(number):
print 1 +
Bo Morris wrote:
> Thank you for your assistance. Based on your direction, I figured it out.
>
> *This... *
>
> def add(number):
> print 1 + int(number)
>
> x = ['2', '4', '6', '8', '10', '12']
>
> [add(item) for item in x]
>
> *Is the same as... *
>
>
> def add(number):
> print
Thank you for your assistance. Based on your direction, I figured it out.
*This... *
def add(number):
print 1 + int(number)
x = ['2', '4', '6', '8', '10', '12']
[add(item) for item in x]
*Is the same as... *
def add(number):
print 1 + int(number)
x = ['2', '4', '6', '8', '10', '1
On Fri, Dec 13, 2013 at 08:03:57PM -0500, Bo Morris wrote:
> i have the following simple function that iterates over the list.
Actually, no it doesn't. One important skill of being a programmer is
precision of language. The function "add" you show below does not
iterate over the list, it is th
On Sat, Dec 14, 2013 at 11:03 AM, Bo Morris wrote:
> 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:
On 14/12/2013 01:03, Bo Morris wrote:
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):