Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tabulate import tabulate
- def ShowFunctional(N: int, Functional_koeff: list) -> None:
- for i in range(N):
- print(f"{Functional_koeff[i]}x_{i+1}", end= "")
- if i == N-1: #в range создается N-1 элементов (начинаем с нуля) => берем i == N-1
- print()
- else:
- print("+", end = "")
- def ShowMatrixElement (A: list, i: int, j: int) -> None:
- for el_i in range(len(A)):
- print ("(", end=" ")
- for el_j in range(len(A[i])):
- print( " X" if (el_i == i and el_j == j) else f"{A[el_i][el_j]:>4}" , end=" ")
- print (")")
- def ShowTable(A: list, B: list, column: list, input_headers: list, input_W: list) -> None:
- headers = [''] + input_headers + ['B']
- data = []
- for i in range(len(A)):
- data.append([column[i]])
- data[i] = data[i] + [i for i in A[i]] + [B[i]]
- data += [['W'] + input_W]
- print( tabulate(tabular_data= data, headers=headers, tablefmt="grid") )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement