castle:/home/adam>python
Python 2.3 (#3, Aug 4 2003, 16:43:33)
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
>>> [[y,x] for x,y in [1,2],[3,4]][/color][/color][/color]
[[2, 1], [4, 3]][color=blue][color=green][color=darkred]
>>> map(lambda x,y: [y,x], [1,2],[3,4])[/color][/color][/color]
[[3, 1], [4, 2]][color=blue][color=green][color=darkred]
>>>[/color][/color][/color]
Why there is a difference? How to make the same thing like in map statement?
Regards
Adam Przybyla
Python 2.3 (#3, Aug 4 2003, 16:43:33)
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on linux2
Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
>>> [[y,x] for x,y in [1,2],[3,4]][/color][/color][/color]
[[2, 1], [4, 3]][color=blue][color=green][color=darkred]
>>> map(lambda x,y: [y,x], [1,2],[3,4])[/color][/color][/color]
[[3, 1], [4, 2]][color=blue][color=green][color=darkred]
>>>[/color][/color][/color]
Why there is a difference? How to make the same thing like in map statement?
Regards
Adam Przybyla
Comment