The Joy of Computing using Python - - Unit 7 - week 4
The Joy of Computing using Python - - Unit 7 - week 4
(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)
Click to register
for Certification
exam
Week 4 : Assignment 4
(https://examform.nptel.ac.in/2025_01/exam_form/dashboard)
The due date for submitting this assignment has passed.
Course n(n
2
+ 1)
outline 2
3
About NPTEL n
() 2
3
n + 2n
How does an
NPTEL online 2
course work? 4 2
n + n
()
2n
2
Week 3 () n
4
+ n
2
2n
week 4 ()
https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=78&assessment=515 1/6
4/15/25, 5:53 PM The Joy of Computing using Python - - Unit 7 - week 4
Practice is the 2) What would the magic constant be for a magic square of size 7, given that all elements 1 point
key (unit? in the square are distinct numbers from 1 to 49?
unit=78&lesson
=79) 260
111
Magic Square:
Hit and Trial 01 175
(unit? 165
unit=78&lesson
=80) Yes, the answer is correct.
Score: 1
Magic Square: Accepted Answers:
Hit and Trial 02 175
(unit?
unit=78&lesson 3) Does transposing any magic square change the sum across some 1 point
=81)
rows/columns/diagonal?
Magic Square:
Hit and Trial 03 Yes
(unit? No
unit=78&lesson
Yes, the answer is correct.
=82)
Score: 1
Magic Square: Accepted Answers:
Hit and Trial 04 No
(unit?
unit=78&lesson 4) Which of the following are valid magic squares ? 1 point
=83)
Magic Square: 10 3 13 8
⎡ ⎤
Hit and Trial 05
⎢ 5 16 2 11 ⎥
(unit? ⎢ ⎥
⎢ 4 9 7 14 ⎥
unit=78&lesson
⎣ ⎦
=84) 15 6 12 1
Let's program 20 − e 6 − e 26 − e 16 − e
⎡ ⎤
and play (unit?
⎢ 10 − e 32 − e 4 − e 22 − e ⎥
unit=78&lesson ⎢ ⎥
⎢ 8 − e 18 − e 14 − e 28 − 2e ⎥
=85)
⎣ ⎦
30 − e 12 − e 24 − e 2 − e
Dobble Game -
Spot the
1 14 4 15
⎡ ⎤
similarity 01
(unit? ⎢ 8 11 5 10 ⎥
⎢ ⎥
⎢ 13 3 ⎥
unit=78&lesson 2 16
⎣ ⎦
=86) 12 7 9 6
Dobble Game -
π 14π 4π 15π
Spot the ⎡ ⎤
unit=78&lesson ⎣
12π 7π 9π 6π
⎦
=87)
No, the answer is incorrect.
Dobble Game -
Spot the
S
https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=78&assessment=515 2/6
4/15/25, 5:53 PM The Joy of Computing using Python - - Unit 7 - week 4
similarity 03 Score: 0
(unit? Accepted Answers:
unit=78&lesson ⎡
10 3 13 8
⎤
=88)
⎢ 5 16 2 11 ⎥
⎢ ⎥
⎢ 4 14 ⎥
Dobble Game - 9 7
⎣ ⎦
Spot the 15 6 12 1
similarity 04 1 14 4 15
⎡ ⎤
(unit?
⎢ 8 11 5 10 ⎥
unit=78&lesson ⎢ ⎥
⎢ 13 2 16 3 ⎥
=89)
⎣ ⎦
12 7 9 6
What is your π 14π 4π 15π
⎡ ⎤
date of birth?
⎢ 8π 11π 5π 10π ⎥
(unit? ⎢ ⎥
⎢ 13π 2π 16π 3π ⎥
unit=78&lesson
⎣ ⎦
=90) 12π 7π 9π 6π
Birthday 5) What is the minimum number of people required to ensure that at least three of them share the
Paradox - Find same 30-minute birth interval? The intervals start from 12:00 AM and each interval lasts for half an
your twin 01 hour.
(unit?
unit=78&lesson 97
=91)
Yes, the answer is correct.
Birthday Score: 1
Paradox - Find Accepted Answers:
your twin 02 (Type: Numeric) 97
(unit?
unit=78&lesson 1 point
=92)
6) Calculate the magic constant for 5x5 square, where all elements are distinct numbers from 1
Birthday to 25, is it same as the magic constant for Ramanujan’s magic square ?
Paradox - Find
your twin 03 If yes, enter 0, else enter the absolute difference between the two.
(unit? Hint: Search the about Ramanujan’s magic square.
unit=78&lesson
=93) 50
What's your
favourite
movie? (unit?
https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=78&assessment=515 3/6
4/15/25, 5:53 PM The Joy of Computing using Python - - Unit 7 - week 4
unit=78&lesson
=96)
Guess the
Movie Name 01
(unit?
unit=78&lesson
=97)
Guess the
Movie Name 02
(unit?
unit=78&lesson
=98)
Guess the
Movie Name 03
(unit?
unit=78&lesson
=99)
Guess the
Movie Name 04
(unit?
unit=78&lesson
=100) Calculate factorial of number n.
Guess the Calculate factors of number n.
Movie Name 05 Calculate factors of number n+1 excluding n.
(unit?
unit=78&lesson
Calculate factors of number n excluding n.
=101) Yes, the answer is correct.
Score: 1
Guess the
Accepted Answers:
Movie Name 06
Calculate factors of number n excluding n.
(unit?
unit=78&lesson 8) For what n1, n2 will the variable flag inside mystery2() be equal to True? 1 point
=102)
1,2
Week 4
Feedback 2,3
Form: The Joy 3,4
of Computing
0,0
using Python
(unit? No, the answer is incorrect.
unit=78&lesson Score: 0
=103) Accepted Answers:
2,3
Quiz: Week 4 :
3,4
Assignment 4
(assessment?
name=515)
9) If all possible pairs of prime numbers between 0 and 10, are given to n1 and n2, for 1 point
how many pairs would 2 print ”Completed” ?
Week 4:
Programming It will print ”Completed” only for pairs (2,3)(7,2),(2,5), and for the remaining it would not print
Assignment 1 ”Completed”.
https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=78&assessment=515 4/6
4/15/25, 5:53 PM The Joy of Computing using Python - - Unit 7 - week 4
(/noc25_cs69/p It will print ”Completed” only for pair (2,3), and for the remaining other pairs of primes it
rogassignment
would not print ”Completed”.
?name=518)
It will print ”Completed” for all pairs of primes between 0 and 20.
Week 4:
It will not print ”Completed” for any pair.
Programming
Assignment 2 Yes, the answer is correct.
(/noc25_cs69/p Score: 1
rogassignment Accepted Answers:
?name=516) It will not print ”Completed” for any pair.
Week 4: 10) If numbers of pairs of primes which result in mystery2 to print ”Completed” are lesser 1 point
Programming than 1, Can we edit the code in mystery2() so that ”Completed” is always printed for any pair of
Assignment 3 primes ?
(/noc25_cs69/p
rogassignment Yes, we can change the logic for setting flag variable to False.
?name=517)
No, it is logically not possible.
Week 5 () Yes, we can change/decrease the threshold for length of list2 in the last if block.
Yes, we can change the initial value of flag to False, instead of True.
Week 6 ()
Yes, the answer is correct.
Score: 1
Week 7 () Accepted Answers:
Yes, we can change/decrease the threshold for length of list2 in the last if block.
Week 8 ()
Week 9 ()
Week 10 ()
Week 11 ()
Week 12 ()
Text
Transcripts ()
Download
Videos ()
Books ()
Problem
Solving
Session - Jan
2025 ()
https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=78&assessment=515 5/6
4/15/25, 5:53 PM The Joy of Computing using Python - - Unit 7 - week 4
https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=78&assessment=515 6/6