Python Program to Find Hypotenuse

The hypotenuse is the longest side of a right triangle. It is also the side that is not opposite the right angle. If you’re trying to find the hypotenuse of a right-angled triangle, you can use the following equation: h …

Read more

Python Program to Find Eigenvalues and Eigenvectors

Program Code import numpy as np A = np.array([[1,2,3],[4,5,6],[7,8,9]]) eigenvalues, eigenvectors = np.linalg.eig(A) print(f"The eigenvalues are {eigenvalues}") print(f"The eigenvectors are {eigenvectors}") Expected Output: The eigenvalues are [ 1.61168440e+01 -1.11684397e+00 -1.30367773e-15] The eigenvectors are [[-0.23197069 -0.78583024 0.40824829] [-0.52532209 -0.08675134 -0.81649658] [-0.8186735 …

Read more

Python Program to Add Two Numbers

Program Code # take two inputs num1 = input('Enter first number: ') num2 = input('Enter second number: ') # add the inputs sum = float(num1) + float(num2) # display the sum print('The sum of {0} and {1} is {2}'.format(num1, num2, …

Read more

Python Program to Find Even or Odd

Even numbers are numbers that are evenly divided into two groups, such as 2, 4, 6, 8, 10. Odd numbers are numbers that are not evenly divided into two groups, such as 1, 3, 5, 7, 9. Program Code num …

Read more