Commit ec8b2304 authored by Littichai Buddaken's avatar Littichai Buddaken

finished

parent 1523470c
def value(v,p=4,n=3):
sign = -1 if v[0]==1 else 1
return sing*sum(v[i]*2**(p-1)for i in range (1,p+n+1))
def value(v,pos=4,neg=3):
sign = -1 if [0] == 1 else 1
return sign * sum([v[i] * 2 ** (pos - i) for i in range(1, pos+neg+1)])
def values(v, pos, neg):
ang= list(map(int,v))
sign = -1 if ang[0] == 1 else 1
return sign * sum([ang[i] * 2 ** (pos - i) for i in range(1, pos + neg + 1)])
#คะแนนพิเศษ
def values(V,p=4,n=3):
v = list(map(int,V))
sign = -1 if v[0]==1 else 1
return sing*sum(v[i]*2**(p-1)for i in range (1,p+n+1))
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