Skip to content

Commit a8c240c

Browse files
committed
Square with map
1 parent 0ea1522 commit a8c240c

File tree

5 files changed

+16
-26
lines changed

5 files changed

+16
-26
lines changed

0x04-python-more_data_structures/100-main.py

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/python3
2+
square_matrix_map = \
3+
__import__('101-square_matrix_map').square_matrix_map
4+
5+
matrix = [
6+
[1, 2, 3],
7+
[4, 5, 6],
8+
[7, 8, 9]
9+
]
10+
11+
new_matrix = square_matrix_map(matrix)
12+
print(new_matrix)
13+
print(matrix)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/python3
2+
def square_matrix_map(matrix=[]):
3+
return (list(map(lambda row: list(map(lambda x: x**2, row)), matrix)))

0x04-python-more_data_structures/12-main.py

-19
This file was deleted.
Binary file not shown.

0 commit comments

Comments
 (0)