The Joy of Computing using Python NPTEL Week 10 all Programming Assignment Solution 2021 March | Week 10
Week 10 Programming Assignment 1 Answer :
N,n,f=int(input()),input().split(),0
ans=[n[i-N:i]for i in range(1,len(n)+1)if i%N==0]
for a in range(len(ans)):
if ans[a].count('1')==2:
f=a+1
if f!=0:
print("yes",f,end="")
else:
print("no",end="")
Week 10 Programming Assignment 2 Answer :
N,n,f,Ans=int(input()),input().split(),0,[]
ans=[n[i-N:i]for i in range(1,len(n)+1)if i%N==0]
for k in range(N):
p=[]
for j in range(N):
p.append(ans[j][k])
Ans.append(p)
for a in range(N):
if Ans[a].count('1')==2:
f=a+1
if f!=0:
print("yes",f,end="")
else:
print("no",end="")
Week 10 Programming Assignment 3 Answer :
N,n,f=int(input()),input().split(),0
ans=[n[i-N:i]for i in range(1,len(n)+1)if i%N==0 and n.count('0')!=N*N]
for a in range(N):
for b in range(N):
if len(ans)>1 and ans[a][b]==ans[b][a] :
f=f+1
if f==N*N:
print("yes",end="")
else:
print("no",end="")
dear viewers: I apologize for not uploading the week 10 videos.
I could not deliver the video to you because of my system damage.
Yes Sir
ReplyDelete