The Joy Of Computing Using Python Week 12 : Assignment 12 | NPTEL | Answers Jan 2023

The Joy of Computing using Python Week 12 - Assignment 12 | NPTEL | Answer with Explanation

The Joy Of Computing Using Python Week 12  : Assignment 12  | NPTEL | Answers Jan 2023

The Joy of Computing using Python - Course | NPTEL - All assignment

"Discover the Excitement of Computing with Python | Week 11 Multiple Choice Questions - Get ready to enhance your programming skills and deepen your understanding of the Python language with this week 12 MCQ on 'The Joy of Computing using Python'. Test your knowledge and boost your confidence as a Python programmer today!"

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.

The following code will return:

def test(word):

	new_word = ''
	for ch in word:
		if ch>='a' and ch<='z":

			temp = ord(ch)
			temp = temp - 32
			temp = chr(temp)
			new_word = new_word + temp

	return new_word
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.

The test function takes a string word as input and returns a new string new_word that is the uppercase version of word.

The function achieves this by iterating over each character ch in word. If ch is a lowercase letter (as determined by the condition ch >= 'a' and ch <= 'z'), the function converts it to uppercase by subtracting 32 from its ASCII code using the ord function, then converting the resulting code back to a character using the chr function. The uppercase letter is then appended to new_word.

If ch is not a lowercase letter, it is ignored and not added to new_word. Finally, the function returns new_word.

It's worth noting that the function only works correctly for ASCII-encoded characters. If word contains non-ASCII characters, the behavior of the function is undefined.

How many edges are there in the following graph?

The Joy Of Computing Using Python Week 12  : Assignment 12  | NPTEL | Answers Jan 2023
a. Three
b. Five
c. Four
d. Two
Answer

c. Four

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

What is the output of the following code?

import networkx as nx
import matplotlib.pyplot as plt

G = nx.Graph()
G.add_nodes_from([1, 2, 3, 4])
G.add_edges_ from([(1, 2), (2, 1), (2, 3), (3, 4), (4,1), (3,1)])

nx.draw(G,with_labels=True)
plt.show()
The Joy Of Computing Using Python Week 12  : Assignment 12  | NPTEL | Answers Jan 2023
Answer

c.

The Joy Of Computing Using Python Week 12  : Assignment 12  | NPTEL | Answers Jan 2023

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)

Which is the following graph?

a. Triangle Graph
b. Directed Graph
c. Barbell Graph
d. Wheel graph
Answer

c. Barbell Graph

What will be the G.out_degree(3) for the following graph(G)?

a. 4
b. 6
c. 3
d. None of the above
Answer

d. None of the above
5

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.

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

Answer

a.

The Joy of Computing using Python - Course | NPTEL - All assignment

Disclaimer:
"This page contains multiple choice questions (MCQs) related to The Joy of Computing using Python . The answers to these questions are provided for educational and informational purposes only.These answers are provided only for the purpose to help students to take references. This website does not claim any surety of 100% correct answers. So, this website urges you to complete your assignment yourself."

The Joy of Computing using Python Week 11,NPTEL ,Assignment 11 [Jan 2023],noc23_cs20

Post a Comment

0 Comments