Page up and page down keys fall under the DIRECTION
keys category
Answer:
import numpy as np
a = int(input ("Enter a"))
b = int(input ("Enter b"))
c = int(input ("Enter c"))
d = int(input ("Enter d"))
c1 = int(input ("Enter c1"))
c2 = int(input ("Enter c2"))
array1 =[[a, b],[c, d]]
A = np.array (array1)
B = np.array ([c1, c2])
X = np.linalg.inv (A).dot (B)
print (X)
Explanation:
let ax + by =c1
cx + dy =c2
We have used the above NumPy library that has the methods for matrix calculation, and here we have used matrix multiplication, and the inverse of a matrix to find the value of x and y.
We know AX=B
X = inv A. B
And this we have used above. We can calculate inv A and do matrix multiplication using NumPy. And thus we get the above solution.
Answer:
The python code is given below with lists defined.
Explanation:
import sys
def isEven(n) :
return ((n % 2) == 0) //for even items
numbers = sys.argv[1].split(',')
for i in range(0,len(numbers)):
numbers[i]= int(numbers[i])
even = []
odd = []
for i in numbers:
if isEven(i):
even.append(i) #adds i to even list if it is even
else:
odd.append(i) #adds i to odd list if not even (odd)
print(odd)
print(even)