The Joy of Computing Using Python Week 4 assignment answers ? Also, we will discuss about the Programming assignment answers of week 4. In this article we will discuss about the answers of week 4 of joy of computing. The answers shared here will be on our own knowledge. I am answering these questions with Confident. Please use this answers as reference only. Â
Also Read:Â The Joy of Computing Using Python Week 3 answers
About NptelÂ
Nptel ( National Programme on technology and enhancement Learning) is a wonderful platform to Students and Professionals . This Nptel is initiated in 2003 by Ministry of Human and Resource Development ( MHRD ) with the combination of IIT (Indian Institue of technology) and IIT sc ( Indian Institue of Sciences ) . To get the certificate , Certain criteria has to be followed:Â
Average Score of assignments = 25% of average of 8 assignments , best of 8 assignments out of 12 assignments.Â
Exam Score = 75% of Protocored ExamÂ
You will be for certificate for the exam if and only if Average assignment score >=10/25 and Exam Score >=30/75 . If any one of the 2 Criteria is not met,Â
You will not get Certificate even if the final score >=40/100. Â
The Joy Of Computing Using Python Week 4 Assignment 2023Â Â
Below you can find the answers of week 4 assignment and also programming assignment.Â
Q1. Which of the following statements are true with regards to magic square?
a. The sum of each row should be m.
b. The sum of each column should be m.
c. The sum of each diagonal should be m.
d. None of the aboveÂ
Answer:Â Â [ a, b, c]Â
Q2. Which of the following statements hold true about N in the magic square? N denotes theÂ
   number of rows and columns in the square.Â
a. N should be even.
b. N should be odd.Â
c. N can be even or odd
d. N can take any value
Answer:  [ b ]  N should be odd. Â
Q3. Which of the following statements are true regarding the Magic Squares?Â
    (N = Number of rows or columns)Â
a. A magic square is always a square matrix .
b. A magic square is can or cannot be a square matrix .Â
c. The Sum of each row and each column is N(N+1 )/2.
d. The Sum of each row and each column is N(N2+1 )/2.Â
Answer:Â Â [ a, d ]Â
Q4. What will be the output of the which is given below?
    Code:Â
         ' ' ' '
         This is a sentenceÂ
         ' ' ' 'Â
a. This is a sentence.
b. Error
c. No output
d. The program will not run.Â
Answer:Â Â [ c ] No Output
Q5. Which of the following operator is used to raise the exponent to a number?
a. ^
b. *
c. **
d. ***
Answer:Â Â [ c ]Â **
Q6. Suppose there is a movie with 3 letters, how many combinations of names are possible?
a. 26
b. 676
c. 17576
d. 456976
Answer:Â Â [ c ]Â 17576
Q7. What should be the value of the a,b,c,d respectively?
                   Â
a. 1, 3, 9, 7
b. 9, 3, 7, 1
c. 1, 7, 3, 9
d. 7, 3, 9, 1
Answer:Â Â [ c ]Â 1, 7, 3, 9
Q8. What is the output of the given code?
a.  Print unique movies of list L1
b.  Print unique movies of list L2
c.  Print unique movies of list L1 and L2
d. It shows an error
Answer:Â Â [ a ]Â Print unique movies of list L1
Q9. What is the output of the given code below?
   Code:Â
         for i in range (5, 20 ) :Â
            if ( i%5 == 0) :Â
              print( i**2 )Â
a. Print all perfect squares with square roots between 5-20 and divisible by 5.
b. Print all perfect squares with square roots between 5-20 and not divisible by 5.
c. Print all perfect squares with square roots between 5-19 and not divisible by 5.
d. Print all perfect squares with square roots between 5-19 and divisible by 5.
Answer:Â Â [ d ]Â Â Print all perfect squares with square roots between 5-19 and divisible by 5.
Q10. A perfect number is a positive integer that is equal to the sum of its positive divisors,Â
     excluding the number itself. For example, 6 is a perfect number as the sum of itsÂ
     divisors 1,2,3 is equal to 6.
     Which function will return True if the number is a perfect number?Â
Answer:Â [ a ]Â
      def perfect_number(num):Â
         ans=0
         for i in range (1, num) :Â
            if ( num% i ==0 ) :Â
              ans = ans + iÂ
         if ( ans == num ) :Â
           return TrueÂ
         else :Â
            return False:Â
 Programming Assignment :Â
n=int(input())Â ans=0for i in range(1,n+1):Â ans+=i**2print(ans,end=""){codeBox}
 n=int(input()) print(2**n, end="") {codeBox}
  If n = 5, the program should output the followingÂ
n=int(input())max_row=1max_row1=1for row in range(1,n+1):  b=0  for space in range(1,n-row+1):    print(" ",end="")  a=row  Left=list()  while(a!=max_row1):    Â    if a>9:      Left.append(str(b))      b=b+1    else:  Â      Left.append(str(a))    a=a+1  if row==n:  Â   print(("".join(Left)+str(max_row)+"".join(Left[::-1])),end="")  else:   print(("".join(Left)+str(max_row)+"".join(Left[::-1])))  if (max_row+2>9):    max_row=-1  max_row+=2  max_row1+=2     {codeBox}    Â