|
11 | 11 | Enter 8 for Area of Triangle |
12 | 12 | Enter 9 for Perimeter of Triangle |
13 | 13 | Enter 10 for Area of Trapezium |
14 | | -Enter 11 for Addition of Two 2x2 Matrixes |
| 14 | +Enter 11 for Addition of Two 2x2 Matrix |
15 | 15 | Enter 12 for Usual Addition Calculations |
16 | | -Enter 13 for Usual Subtration Calculations |
| 16 | +Enter 13 for Usual Subtraction Calculations |
17 | 17 | Enter 14 for Usual Multiplication Calculations |
18 | | -Enter 15 for Usual Division Calculcations |
| 18 | +Enter 15 for Usual Division Calculations |
19 | 19 | >>> """)) |
20 | 20 | except ValueError: |
21 | 21 | print("You have entered an invalid input. Please try again.") |
|
67 | 67 | elif cmd == 10: |
68 | 68 | a = float(input("Enter base of trapezium: ")) |
69 | 69 | b = float(input("Enter top length of trapezium: ")) |
70 | | - height = float(input("Enter height of trapezim: ")) |
| 70 | + height = float(input("Enter height of trapezium: ")) |
71 | 71 | if cmd == 10: |
72 | 72 | print(0.5 * (a + b) * height) |
73 | 73 | else: |
|
85 | 85 | m21 = float(input("Enter the element of 1st column and 2nd row of 2nd matrix :")) |
86 | 86 | m22 = float(input("Enter the element of 2nd column and 2nd row of 2nd matrix :")) |
87 | 87 |
|
88 | | - X = [[n11,n12],[n21,n22]] |
89 | | - Y = [[m11,m12],[m21,m22]] |
90 | | - result = [[0, 0],[0,0]] |
91 | | - # Iterate Through Rows |
| 88 | + X = [[n11, n12], [n21, n22]] |
| 89 | + Y = [[m11, m12], [m21, m22]] |
| 90 | + result = [[0, 0],[0, 0]] |
| 91 | + # Iterate Through Rows |
92 | 92 | for i in range(len(X)): |
93 | 93 | # iterate through columns |
94 | 94 | for j in range(len(X[0])): |
|
0 commit comments