def main(): m1 = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] m2 = [[6, 5, 0], [1, 3, 9], [0, 2, 1]] print(matrices.add_matrices(m1, m2)) print(matrices.sub_matrices(m1, m2)) print(figures.square_area(2)) print(figures.triangle_area(6, 3))
def test_sub_matrices(): a = [[1, 2, 3], [4, 5, 6]] b = [[7, 8, 9], [10, 11, 12]] results = add_matrices(a, b) assert results == [ [-6, -6, -6], [-6, -6, -6], ]
def add_matrices(): # matryca to jest lista list a = [[1, 2, 3], [4, 5, 6]] b = [[7, 8, 9], [10, 11, 12]] results = add_matrices(a, b) assert results == [ [8, 10, 12], [14, 16, 18], ]
def test_add_matrices2(): a = [[1,2,3], [4,5,6]] b = [[1,1,1], [0,0,0]] c = [[2,3,4], [4,5,6]] assert add_matrices(a,b) == c
def test_add_matrices(): A = [ [1, 2, 3], [4, 5, 6], ] B = [ [7, 8, 9], [10, 11, 12], ] result = add_matrices(A, B) assert result == [[8, 10, 12], [14, 16, 18]]
def test_add_matrices_with_diffrent_count_of_rows(): a = [ [1, 2], [3, 4], [5, 6], ] b = [ [7, 8, 9], [10, 11, 12], ] with pytest.raises(ValueError) as e: result = add_matrices(a, b)
def test_add_matrices(): a = [[1,2,3], [4,5,6], [7,8,9]] b = [[1,1,1], [0,0,0], [2,2,2]] c = [[2,3,4], [4,5,6], [9,10,11]] assert add_matrices(a,b) == c
def test_add_matrices(): a = [ [1, 2, 3], [4, 5, 6], ] b = [ [7, 8, 9], [10, 11, 12], ] result = add_matrices(a, b) assert result == [ [8, 10, 12], [14, 16, 18], ]
def main(): m1 = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] m2 = [ [6, 5, 0], [1, 3, 9], [0, 2, 1] ] print( "Suma przykładowych macierzy:", matrices.add_matrices(m1, m2)) print("Pole kwadratu o boku 2 jest", figures.square_area(2))
def test_add_matrices_with_different_count_of_rows(): A = [ [1, 2], [3, 4], [3, 4], ] B = [ [7, 8], [10, 11], ] with pytest.raises( ValueError ): # test sprawdza czy błąd zostanie rzuciony, zaimpoortowqaliśmy do tego pytest result = add_matrices(A, B) assert result == []
def test_add_matrices(): X = [ [1, 2, 3], [4, 5, 6], ] Y = [ [ 7, 8, 9, ], [10, 11, 12], ] result = add_matrices(X, Y) assert result == [ [8, 10, 12], [14, 16, 18], ]
def test_add_matrices(): m1 = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] m2 = [[6, 5, 0], [1, 3, 9], [0, 2, 1]] assert matrices.add_matrices(m1, m2) == [[7, 7, 3], [5, 8, 15], [7, 10, 10]]
def test_add_matrices(): assert add_matrices(a, b) == [[6, 8], [10, 12]]
def test_add_matrices(): m1 = [[1, 1], [2, 2]] m2 = [[2, 2], [3, 3]] assert add_matrices(m1,m2) == print([[3, 3], [5, 5]])
import sys print(sys.path) #from zjazd3/Dzien2 import Vector from mathematica.algebra.matrices import add_matrices, sub_matrices add_matrices(A, B)
def test_add_matrices(): m1 = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] m2 = [[6, 5, 0], [1, 3, 9], [0, 2, 1]] expected = [[1 + 6, 2 + 5, 3 + 0], [4 + 1, 5 + 3, 6 + 9], [7 + 0, 8 + 2, 9 + 1]] assert matrices.add_matrices(m1, m2) == expected
def test_add_matriece(): a = [[1, 2, 3], [1, 2, 3]] b = [[1, 2, 3], [1, 2, 3]] result = add_matrices(a, b) expected = [[2, 4, 9], [2, 4, 9]] result == expected
def test_dodawanie_matryc(): assert matrices.add_matrices([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]