The Joy of Computing with Python Unproctored exam (10-11 am) Review | Question paper and answer given
*Read Also -> Joc evening session review (question and answer included)
*Read Also -> Joc Proctored exam (Dec 19, 2020) Review
Note:
In future batches they may ask more questions or less questions but any number of questions they ask that can be solved within 1hour. Because they fix the questions in that way. For this session (Dec 2020) morning 10-11am Unproctored exam, they asked only one question to solve.
Note:
This is for only educational purpose. The question and answer for the exam in this blog is posted only after the exam is completed i.e. after 11 am for morning session.
Question paper and answer for nptel JOC Unproctored exam 10-11 AM
Programming exam 1: Decode the script
Input Format:
The first line contains space-separated integers N (rows) and M (columns) respectively.
The next N lines contain the row elements of the matrix script separated by space.
Output Format:
Print the decoded matrix script.
Sample Input:
7 3
T s i
h % x
i # $
s M #
$ a &
# t %
i r !
Output:
ThisisMatrix
Answer (my own solution) :
a,b=map(int,input().split()) l=[] for i in range(a): c=input().split() l.append(c) ans=[] for j in range(b): for i in range(a): if l[i][j].isalpha(): #checking alphabet ans.append(l[i][j]) elif l[i][j].isdigit(): #checking number ans.append(l[i][j]) else: pass print("".join(ans),end="")
This answer passed in both public and private test cases. There are many ways to solve this problem not only this.
*Also Read -> Joc evening session review (question and answer included)
*Also Read -> Joc Proctored exam (Dec 19, 2020) Review
Content Last Updated on 5th August 2021, 3:00 PM IST
Post a Comment