NPTEL Joy Of Computing Using Python Week 10 Answers 2023

Hey Folks, Hope you are doing well. In this article, we are discussing about the answers week 10 of  Joy Of Computing Using Python. I am answering these answers to the best of my knowledge. If any change in the answers, please visit the website on or before to the last date. Then y waiting Come with us until the last to know more about this module of week 10.

Joy Of Computing Using Python


NPTEL Joy Of Computing Using Python Week 10 Answers 2023 

Last Date: 04-10-2023
 
Q1. What is the output of the following Code?

     s='Hello Everyone'
     print(s.lower()) {codeBox}

 A. HELLO EVERYONE
 B. Hello Everyone
 C. helloeveryone
 D. hello everyone

Answer: [ D ]  hello everyone



Here lower is a keyword which converts all higher case letters to the lower case letters.

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

Answer: [ A ]  When only one letter is left in flames. 

In Flames, after cancelling out all letters, only one letter is left will be remaining in the Word FLAMES. 

Q3. Output of the Code will be ?

a = [ ' ' , ' h ' , ' e ' , ' l ' , ' l , ' o ' ]
print(' . ' join (a)) {codeBox}

A.  hello
B.  h.e.l.l.o
C  .h.e.l..l.o
D. .h.e.l.l.o

Answer: [ C ]  .h.e.l.l.o




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

Answer: [ D ] 

Q5. What will be the output of the following list slicing ? 

s = ' The Joy Of Computing ' 
print ( s [ 3:12] ) {codeBox}

A. 'Joy of C'
B. ' Joy of C'
C. 'Joy of Co'
D. ' Joy of Co' 

Answer: [ B ]  ' Joy of C'

Q6. What does the following code represents ? 

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 )  {codeBox} 

A. Replacing all letters at odd index with ‘_’.
B. Replacing all vowels at odd index with ‘_’.
C. Replacing all vowels at even index with ‘_’.
D. Replacing all letters at even index with ‘_’. 

Answer: [ C ]  Replacing all vowels at even index with ‘_’.

Q7. What will be the output of the following code ? 

import numpy as np
b = np.array ( [ [ 1,2 ] , [ 3, 4 ] ] ) 
print ( np.sum ( b, axis = 1 ) ) {codeBox} 

A. [ 4 6 ]
B. [ 3 7 ] 
C. [ 3 4 ] 
D. None of the above 

Answer: [ B ]  [ 3 7 ] 

Q8.  What is the correct way to display the transpose of the matrix ? 

Answer: [ B ] 

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

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

Answer: [ B ]  No, they are different.

Q10. 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: (2,3)

Q11. 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 )  {codeBox}

 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]]

Answer: [ B ] 


Conclusion: 


If any change in the answers please visit the website on or before to the last date.



 

One Comment Please !

Post a Comment (0)
Previous Post Next Post