# NPTEL The Joy Of Computing Using Python Week 10 Assignment July 2023 | NPTEL

## What is the output of the following code?

s = 'Hello Everyone'
print(s.lower())

a. HELLO EVERYONE
b. Hello Everyone
c. helloeveryone
d. hello everyone

d. hello everyone

## In flames game when we will stop the iteration over FLAMES?

a. When only one letter is left in flames.
b. Only once.
c. Only the letter remaining times.
d. None of the above.

a. When only one letter is left in flames.

## Output of the following code will be?

a = ['','h','e','l','','l','o']
print('',join(a))
a. hello
b. h.e.l.l.o
c .h.e.l..l.o
d .h.e.l.l.o

c .h.e.l..l.o

## Which code snippet represents replacing all vowels with ‘_’ in a string?

s='The joy of Computing'

s = s.replace('a', '-')
s = s.replace('e', '-')
s = s.replace('i', '-')
s = s.replace('o', '-')
s = s.replace('u', '-')

print(s)

## What will be the output of the following list slicing.

s = 'The Joy of Computing'

print(s[3:12])

‘ Joy of C’

## What does the following code represent?

s =  'Sheher mein'
a = 'aeiouAEIOU'
for i in range(len(s)):
if(s.index(s[i])%2 == 0):
print(i)
if(s[i] in a):
s = s.replace(s[i], '_')
print(s)

Replacing all vowels at even index with ‘_’.

## What will be the output of the following code?

import numpy as np
b = np.array([[1,2,[3,4]])

print(np.sum(b,axix = 1))

[3 7]

## What is the correct way to display the transpose of a matrix?

import numpy as np
b = np.array([[1,2],[3,4]])

print(b.transpose())
import numpy as np
b = np.array([[1,2],[3,4]])

print(b.T)

## Are Lossy and Lossless compressions the same?

a. Yes, they are identical.
b. No, they are different.
c. It depends on the context.
D. Not enough information provided.

b. No, they are different.

a. (2,3)
b. (3,2)
c. (3,3)
d. (2,2)

a. (2,3)

## What will be the output of the following code?

import numpy as np

a = np.array([[8,9,20],[10,31,22]])
b = np.array([[1,2,3],[4,5,6]])

print(a-b)
[[ 7 7 17]
[ 6 26 16]]

### |All Assignment: The Joy of Computing using Python - Course | NPTEL

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."