Commit 658dc576 authored by Aruchira's avatar Aruchira

Up

parent 48ee46c8
print('hello world')
# cookiecutter .....
print("we' ve done it.")
This diff is collapsed.
def value (v,pos=4,ne=3):
sign = -1 if v[0]==1 else 1
return sign*sum([v[i]*2**(pos-i) for i in range(1,(pos+ne)+1)] )
print( value(v,4,3) )
def values(v, pos, ne):
aa=list(map(int,v))
sign = -1 if aa[0] == 1 else 1
return sign * sum([aa[i] * 2 ** (pos - i) for i in range(1, (pos + ne) + 1)])
#59110440309
#ภัทราภรณ์ อินทา
def ge(A,):
pass
def solve(A,b):
import numpy.linalg
result = numpy.linalg.solve(A,b)
for x in result
print('Sx_l{}S'.format(x))
#5x3
m,n= map(int,input().split('x'))
print(n,m)
A=[]
for i in rang(m)
A.apprnd(list(map(int,inpt().split(','))))
print(n,)
b = list(map(int,input().split(',')))
def ge(A, b):
n = len(b)
for j in range(0, n-1):
for i in range(j+1, n):
lam = A[i,j]/A[j,j]
A[i,j:n] = A[i, j:n] - lam*A[j, j:n]
b[i] = b[i] - lam*b[j]
x = b.copy()
for k in range(n-1, -1, -1):
x[k] = (b[k] - np.dot(A[k,k+1:n], x[k+1:n]))/A[k,k]
print(x)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment