Home

Learn Programming & Prepare for NPTEL Exams... Swayam Solver is your one-stop destination for NPTEL exam preparation.

Programming, Data Structures and Algorithms using Python | Week 3 Programs Jan-2022 | NPTEL

 Programming, Data Structures And Algorithms Using Python


--------------------------------------------
Week 3 Programming Assignment
--------------------------------------------

		Due on 2022-02-17, 23:59 IST

def remdup(l):
  p=[]
  for x in l:
    if(x not in p):
      p=p+[x]
  return(p)




def sumsquare(l):
  list=[0,0]
  for i in range(len(l)):
    if l[i]%2==0:
      list[1]+=l[i]**2
    else:
      list[0]+=l[i]**2
  return (list)




def transpose(m):
  list=[]
  c=len(m[0])
  r=len(m)
  for i in range(0,c):
    li=[]
    for j in range(0,r):
      li=li+[m[j][i]]
    list=list+[li] 
  return(list)





~~~THERE IS SOME INVISIBLE CODE HERE~~~
----------------------------------------------------------

No comments:

Post a Comment

Keep your comments reader friendly. Be civil and respectful. No self-promotion or spam. Stick to the topic. Questions welcome.