<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Tricks and tricks with lists
Python Lists are a flexible container that holds other objects
lambda - shorthand to create an anonymous function
zip - take iterables and zip them into tuples
map - applies a function over an iterable
Step1:  Simple list comprehensions
Step2:  Filtering list comprehensions
Step3:  Nested list comprehensions
Step4:  Having fun with Zip
<ASSISTANT_TASK:>
Python Code:
x = [1,2,3]
lambda x: max(x)
Explanation: Tricks and tricks with lists
Python Lists are a flexible container that holds other objects
lambda - shorthand to create an anonymous function
zip - take iterables and zip them into tuples
map - applies a function over an iterable
End of explanation
a = range(-5,5)
## with builtins
b = map(abs,a)
c = [abs(x) for x in a]
print b==c,b
## with your own function
b = [x**2 for x in a]
print b==c,b
Explanation: Simple list comprehensions
End of explanation
import types
## filter
a = ['', 'fee', '', '', '', 'fi', '', '', '', '', 'foo', '', '', '', '', '', 'fum']
b = filter(lambda x: len(x) > 0,a)
c = [x for x in a if len(x) > 0]
print b==c,b
## square only the ints and filter the rest                                                                                                                                                                           
a = [1, '4', 9, 'a', 0, 4]
b = [ x**2 for x in a if type(x)==types.IntType ]
c = map(lambda x: x**2, filter(lambda x: isinstance(x,int) == True,a))
print b==c,b
Explanation: Filtering list comprehensions
End of explanation
a = [1, 2, 3, 4]
[elem*2 for elem in
 [item+1 for item in li] ] 
Explanation: Nested list comprehensions
End of explanation
a1,a2 = [1,2,3],['a','b','c']
print zip(a1,a2)    
print zip(*[a1,a2])    
dict(zip(a2,a1))
## transpose
a = [[1,2,3],[4,5,6]]
print(a)
b = map(list, zip(*a))
c = [[row[i] for row in a] for i in range(len(a[0]))]
print b==c,b
## rotate (to the right 90 degrees)
b = map(list, zip(*a[::-1]))
c = [[row[i] for row in a[::-1]] for i in range(len(a[0]))]
print b==c,b
## Are list comprehensions always easier?
b = map(lambda x: max(x), zip(*a))
## what is the equivalent list comprehension?
c =[max(tpl) for tpl in [[row[i] for row in a] for i in range(len(a[0]))]]
print b==c,b
Explanation: Having fun with Zip
End of explanation
<END_TASK>