generated from justuser-31/code_projects_template
Решения на первый блок
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
matrix = []
|
||||
for i in range(10):
|
||||
matrix.append([0,0,0,0,0,0,0,0,0,0])
|
||||
#matrix.append([])
|
||||
|
||||
# Fill from left-top to right-top
|
||||
for i in range(10):
|
||||
matrix[0][i] = i
|
||||
# Fill from left-top to left-bottom
|
||||
for i in range(10):
|
||||
matrix[i][0] = i
|
||||
|
||||
# Fill crosshairs
|
||||
for x in range(1, 10):
|
||||
for y in range(1, 10):
|
||||
# Values from left side and top side
|
||||
l_val = matrix[x][0]
|
||||
t_val = matrix[0][y]
|
||||
# Set value on zero-place
|
||||
matrix[x][y] = l_val * t_val
|
||||
|
||||
for line in matrix:
|
||||
for el in line:
|
||||
if el >= 10:
|
||||
print(f'{el} ', end='')
|
||||
else:
|
||||
print(f'{el} ', end='')
|
||||
print()
|
||||
Reference in New Issue
Block a user