Ans :
def matrixflip(m,d):
H=[]
if d=='h':
for r in m:
hr=[]
for raw in range(1,len(r)+1):
hr.append(r[-raw])
H.append(hr)
return(H)
if d=='v':
V=[]
for vr in range(1,len(m)+1):
V.append(m[-vr])
return (V)
def remdup(l):
m=l[:]
for w in range(len(l)-1):
if l[w] in l[w+1:]:
m.remove(l[w])
return (m)
def splitsum(l):
(pos,neg)=(0,0)
for v in l:
if v>0:
pos=pos+v*v
if v<0:
neg=neg+v*v*v
return ([pos,neg])
No comments: