# The Joy of Computing using Python | NPTEL 2022 | Week 10 Assignment Solutions

This set of MCQ(multiple choice questions) focuses on the The Joy of Computing using Python NPTEL 2022 Week 10 Assignment Solutions.

The course carries programming to your work area with stories, similarities and distinguished models. Going reflections to experiences and designing to engineering, the course concentrates fundamentally to rouse the student’s psyche to automatically think intelligently and show up at an answer. As a feature of the course, you will figure out how to practice and culture the craft of programming with Python as a language.

### Course layout

NOTE: You can check your answer immediately by clicking show answer button. The Joy of Computing using Python NPTEL 2022 Week 10 Assignment Solution” contains 10 questions.

Now, start attempting the quiz.

### The Joy of Computing using Python NPTEL 2022 Week 10 Assignment Solutions

Q1. Which math problem flames is related to?

b) Josephus problem
c) Conjecture Collatz
d) Dijkstra Problem

Q2. Which of the following is the task of s.upper()(Given the string name is â€˜sâ€™)?

a) It converts the first character into uppercase.
b) It converts every vowel into uppercase.
c) It converts every single character into uppercase.
d) It converts consonants into uppercase.

Answer: c) It converts every single character into uppercase.

Q3. What is the output of the following code?
s = ‘The Joy of Computing’
print(s[:])

a) ‘The Joy of Computing’
b) ‘ Joy of C’
c) ‘Joy of C’
d) Error

Answer: a) ‘The Joy of Computing’

Q4. What will be the output of the following program?
import numpy as np
b = np.array([[1, 2]]), [3, 4]
print(np.sum(b))

a) [[3, 7]]
b) [[4, 6]]
c) [[5, 5]]
d) [[4, 4]]

Q5. What will be the output of the following program?
s = ‘I am amazed’
s.replace(‘a’, ‘z’)
print(s)

a) I zm zmzzed
b) I zm zmazed
c) I am zmzzed
d) I am amazed

The Joy of Computing using Python NPTEL week 10 Assignment Solutions

Q6. What are the consequences of image compression?

a) Less size
b) Lower quality
c) More size
d) Higher quality

Q7. What will be the output of the following program?
s = ‘ JOC ‘
print(‘#’.join(s))

a) JOC
b) #J#O#C#
c) #J#O#C
d) J#O#C

The Joy of Computing using Python NPTEL week 10 Assignment Solutions

Q8. How to take a transpose of a matrix?

The Joy of Computing using Python NPTEL week 10 Assignment Solutions

Q9. Consider the following code.
What print(a+b) will produce?

a) [[6 6 6]
[6 6 6]]
b) [[ -7 -7 -17]
[ -6 -26 -16]]
c) [[ 7 7 17]
[ 6 26 16]]
d)  [[ 9 11 23]
[14 36 28]]

Q10. what is the output of the following code?

a) [[ 1 2 3 4]
[ 5 6 7 8]
[ 9 10 11 12]]
b) [[ 1 2 3]
[ 4 5 6]
[ 7 8 9]
[10 11 12]]
c) Error