Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gmolveau
GitHub Repository: gmolveau/python_full_course
Path: blob/master/exercices/imperative/matrix/matrix_solution.py
306 views
1
def print_matrix(n1: int, n2: int) -> None:
2
if not 0 <= n1 <= 9:
3
raise ValueError("n1 should be between 0 and 9")
4
if not 0 <= n2 <= 9:
5
raise ValueError("n2 should be between 0 and 9")
6
for i in range(10):
7
for j in range(10):
8
if i == n2 or j == n1:
9
print("**", end=" ")
10
else:
11
print(f"{i}{j}", end=" ")
12
print()
13
14
15
print_matrix(n1=3, n2=6)
16
17