# Using above first method to create a # 2D array rows, cols = (5, 5) arr = [[0]*cols]*rows print(arr)
x = [[foo for i in range(10)] for j in range(10)] # x is now a 10x10 array of 'foo' (which can depend on i and j if you want)
bar = [SOME EXPRESSION for item in some_iterable]