The Joy of Computing using Python | NPTEL 2023 | Week 12 Assignment Solutions

ABOUT THE COURSE :

A fun filled whirlwind tour of 30 hrs, covering everything you need to know to fall in love with the most sought after skill of the 21st century. The course brings programming to your desk with anecdotes, analogies and illustrious examples. Turning abstractions to insights and engineering to art, the course focuses primarily to inspire the learner's mind to think logically and arrive at a solution programmatically. As part of the course, you will be learning how to practice and culture the art of programming with Python as a language. At the end of the course, we introduce some of the current advances in computing to motivate the enthusiastic learner to pursue further directions.

Course Status     :    Upcoming
Course Type        :    Elective
Duration               :    12 weeks
Start Date            :    23 Jan 2023
End Date              :    14 Apr 2023
Exam Date           :    29 Apr 2023 IST
Enrollment Ends :    30 Jan 2023

CRITERIA TO GET A CERTIFICATE :

Average assignment score = 25% of average of best 8 assignments out of the total 12 assignments given in the course.
Exam score = 75% of the proctored certification exam score out of 100

Final score = Average assignment score + Exam score

YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF AVERAGE ASSIGNMENT SCORE >=10/25 AND EXAM SCORE >= 30/75. If one of the 2 criteria is not met, you will not get the certificate even if the Final score >= 40/100.

NOTE: Please note that there will not be an unproctored programming exam for this course this term.

The Joy of Computing using Python Week 12 Assignment Solutions :-

Q1) NLTK ________.
a) Helps to work with human language data.
b) Helps to convert machine data into human language.
c) Helps to work on gibberish language.
d) Helps to translate dog language into human language

Answer :- (a) Helps to work with human language data. 

Q2) The following code will return:

a) Converting lower case letters into upper case.
b) Converting upper case letters into lower case.
c) Return the same word
d) Error

Answer :- (a) Converting lower case letters into upper case. 

Q3) How many edges are there in the following graph?
week 12
a) Three
b) Five
c) Four
d) Two

Answer :- (c) Four 

Q4) A complete graph will have a degree of separation.
a) 2
b) 1
c) 3
d) Depends on the number of nodes.

Answer :- (b) 1 

Q5) What is the output of the following code?
week 12

Answer :- (c)  
ans


Q6) What is the shape of the following numpy array?
numpy.array([ [1,2,3], [4,5,6] ])
a) (2,3)
b) (3,2)
c) (3,3)
d) (2,2)

Answer :- (a) (2,3) 

Q7) Which is the following graph?
weeek 12

a) Triangle Graph
b) Directed Graph
c) Barbell Graph
d) Wheel graph

Answer :- (c) Barbell Graph 

Q8) What will be the G.out_degree(3) for the following graph(G)?
WEEk 12
a) 4
b) 6
c) 3
d) None of the above

Answer :- (d) None of the above 

Q9) What should we do when encountered a sink?
a) Stop the algorithm.
b) Start with the last node.
c) Randomly choose a node from all nodes.
d) Randomly choose a node from neighbor nodes.

Answer :- (c) Randomly choose a node from all nodes. 

Q10) Which of the following is a star graph of node 5?

Answer :- (a
ans

 Week 12 Programming Assignment 1 :- 

Write a program to an integer as an input and reverse that integer.

Input:
A single integer.

Output:
Reverse number of that integer.

Example:

Input:
54321

Output:
12345
Week 12 Programming Assignment 1
n=int(input())
print(int("".join(list(str(n))[::-1])),end="")

 Week 12 Programming Assignment 2 :- 

Given a list of strings, write a program to write sort the list of strings on the basis of last character of each string.

Input:
L = ['ram', 'shyam', 'lakshami']

Output:
['lakshami', 'ram', 'shyam']
Week 12 Programming Assignment 2
s=input().split()
res=[]
for i in s:
  res.append("".join(list(i)[::-1]))
ans=[]
for i in sorted(res):
  ans.append("".join(list(i)[::-1]))
print(ans,end="") 

 Week 12 Programming Assignment 3 :- 

Given a student's roll number in the following format rollNumber@institute.edu.in, write a program to find the roll number and institute name of the student.

Input:
roll@institute.edu.in

Output:
roll institute
Week 12 Programming Assignment 3
rollg=input()
print(rollg.split('@')[0],rollg.split('@')[1].split(".")[0],end="") 

Join us :       


ALL THE BEST FOR EXAM