I've started to discover the real handiness with lambda expressions in python. I would like to print out each string in a list without having a for loop and I thought this was the perfect candidate for lambda. This is what I'm doing: map(lambda x: print x, ['line one', 'line two']) and I get the following error: File "<stdin>", line 1 map(lambda x: print x, ['line one', 'line two']) ^ SyntaxError: invalid syntax I can do it fine with things like string.replace, but for some reason does it not like built-in functions? Is there a way to do what I'm wanting to do? Or must I use a for loop? Thanks in advance, Jeff "Shippy" Shipman E-Mail: shippy at nmt.edu Computer Science Major ICQ: 1786493 New Mexico Institute of Mining and Technology Homepage: http://www.nmt.edu/~shippy
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4