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)
If already registered, The due date for submitting this assignment has passed.
2
How does an NPTEL
online course work? () n
3
Week 1 ()
3
n + 2n
Week 2 () 2
4 2
n + n
Week 3 ()
2n
Trial 01 (unit? 2n
unit=78&lesson=80)
⎡ ⎤
https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=78&assessment=515 1/3
04/04/2025, 09:32 The Joy of Computing using Python - - Unit 7 - week 4
10 3 13 8
Dobble Game - Spot the ⎡ ⎤
similarity 04 (unit? ⎢ 5 16 2 11 ⎥
⎢ ⎥
unit=78&lesson=89) ⎢ 4 9 7 14 ⎥
⎣ ⎦
What is your date of 15 6 12 1
birth? (unit?
unit=78&lesson=90) ⎡
20 − e 6 − e 26 − e 16 − e
⎤
⎢ 10 − e 32 − e 4 − e 22 − e ⎥
Birthday Paradox - Find ⎢ ⎥
⎢ 8 − e 18 − e 14 − e 28 − 2e ⎥
your twin 01 (unit?
⎣ ⎦
unit=78&lesson=91) 30 − e 12 − e 24 − e 2 − e
movie? (unit? ⎢ 5 16 2 11 ⎥
⎢ ⎥
unit=78&lesson=96) ⎢ 4 9 7 14 ⎥
⎣ ⎦
15 6 12 1
Guess the Movie Name
1 14 4 15
01 (unit? ⎡ ⎤
unit=78&lesson=97) ⎢ 8 11 5 10 ⎥
⎢ ⎥
⎢ 13 2 16 3 ⎥
Guess the Movie Name
⎣ ⎦
02 (unit? 12 7 9 6
unit=78&lesson=98) ⎡
π 14π 4π 15π
⎤
⎢ 8π 11π 5π 10π ⎥
Guess the Movie Name ⎢ ⎥
⎢ 13π 2π 16π 3π ⎥
03 (unit?
⎣ ⎦
unit=78&lesson=99) 12π 7π 9π 6π
Guess the Movie Name 5) What is the minimum number of people required to ensure that at least three of them share the same 30-minute birth interval? The
04 (unit? intervals start from 12:00 AM and each interval lasts for half an hour.
unit=78&lesson=100)
97
Guess the Movie Name
05 (unit? Yes, the answer is correct.
unit=78&lesson=101) Score: 1
Accepted Answers:
Guess the Movie Name (Type: Numeric) 97
06 (unit?
unit=78&lesson=102) 1 point
Week 4 Feedback Form: 6) Calculate the magic constant for 5x5 square, where all elements are distinct numbers from 1 to 25, is it same as the magic constant for
The Joy of Computing Ramanujan’s magic square ?
using Python (unit?
unit=78&lesson=103)
If yes, enter 0, else enter the absolute difference between the two.
Quiz: Week 4 : Hint: Search the about Ramanujan’s magic square.
Assignment 4
(assessment?
74
name=515)
Yes, the answer is correct.
Score: 1
Week 4: Programming
Assignment 1
Accepted Answers:
(/noc25_cs69/progassign
(Type: Numeric) 74
ment?name=518)
1 point
Week 4: Programming
7) What task does mystery1() perform? 1 point
Assignment 2
(/noc25_cs69/progassign
ment?name=516)
Week 4: Programming
Assignment 3
(/noc25_cs69/progassign
ment?name=517)
Week 5 ()
Week 6 ()
Week 7 ()
https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=78&assessment=515 2/3
04/04/2025, 09:32 The Joy of Computing using Python - - Unit 7 - week 4
Week 8 ()
Week 9 ()
Week 10 ()
Week 11 ()
Text Transcripts ()
Download Videos ()
Books ()
Problem Solving
Session - Jan 2025 ()
8) For what n1, n2 will the variable flag inside mystery2() be equal to True? 1 point
1,2
2,3
3,4
0,0
Partially Correct.
Score: 0.5
Accepted Answers:
2,3
3,4
9) If all possible pairs of prime numbers between 0 and 10, are given to n1 and n2, for how many pairs would 2 print ”Completed” ? 1 point
It will print ”Completed” only for pairs (2,3)(7,2),(2,5), and for the remaining it would not print ”Completed”.
It will print ”Completed” only for pair (2,3), and for the remaining other pairs of primes it would not print ”Completed”.
It will print ”Completed” for all pairs of primes between 0 and 20.
It will not print ”Completed” for any pair.
Yes, the answer is correct.
Score: 1
Accepted Answers:
It will not print ”Completed” for any pair.
10) If numbers of pairs of primes which result in mystery2 to print ”Completed” are lesser than 1, Can we edit the code in mystery2() 1 point
so that ”Completed” is always printed for any pair of primes ?
Yes, we can change the logic for setting flag variable to False.
No, it is logically not possible.
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.
https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=78&assessment=515 3/3