The Joy of Computing using Python - - Unit 9 - Week 6
The Joy of Computing using Python - - Unit 9 - Week 6
(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)
Click to register
for Certification
exam
Week 6 : Assignment 6
(https://examform.nptel.ac.in/2025_01/exam_form/dashboard)
The due date for submitting this assignment has passed.
Course
outline
About NPTEL
()
Sum of numbers from 1 to n
2) Assertion (A): If a recursive function doesn’t have a base case, it may never stop. 1 point
Week 3 ()
Reason (R): Recursion means that a function calls itself.
week 4 () Both (A) and (R) are true, and (R) is the correct explanation of (A).
Both (A) and (R) are true, but (R) is not the correct explanation of (A).
https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=124&assessment=523 1/5
4/15/25, 5:54 PM The Joy of Computing using Python - - Unit 9 - Week 6
Substitution
Cipher -The
science of
secrecy 01
(unit?
unit=124&lesso
n=126)
Substitution
Cipher -The
science of
secrecy 02
(unit?
unit=124&lesso
n=127) Error
25
Substitution
Cipher -The 26
science of 5
secrecy 03
(unit? Yes, the answer is correct.
Score: 1
unit=124&lesso
n=128) Accepted Answers:
26
Tic Tac Toe -
Down the
4) In English, the letter ‘z’ usually appears far less often than most letters. Now imagine 1 point
memory Lane
applying a Substitution Cipher to a large body of English text, where ‘z’ is replaced by ‘r’, and every
(unit?
other letter is also mapped to a unique letter. After encryption, which letter is likely to be the least
unit=124&lesso
n=129)
frequent in the new text?
Hint: Search the internet for more info, if needed.
Tic Tac Toe -
Down the z
memory Lane
r
01 (unit?
unit=124&lesso e
n=130) It is not possible to determine
https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=124&assessment=523 2/5
4/15/25, 5:54 PM The Joy of Computing using Python - - Unit 9 - Week 6
unit=124&lesso 5) If you have a large ciphertext produced by a simple substitution cipher on an English 1 point
n=131) text, can you determine the original message by examining how often each letter appears?
Tic Tac Toe -
Hint: Search the internet for more info, if needed.
Down the
Yes, it can be done.
memory Lane
03 (unit? No, it cannot be done.
unit=124&lesso
Yes, the answer is correct.
n=132) Score: 1
Tic Tac Toe - Accepted Answers:
Down the Yes, it can be done.
memory Lane
04 (unit? 6) Suppose you suspect that a piece of ciphertext was produced using a simple sub- 1 point
unit=124&lesso stitution cipher. Under which circumstances might frequency analysis fail to yield accurate results?
n=133)
The ciphertext is short.
Tic Tac Toe -
Down the The ciphertext was encrypted with another method before encrypting with sub-stitution
memory Lane cipher.
05 (unit? The ciphertext is very long.
unit=124&lesso
n=134) Yes, the answer is correct.
Score: 1
Recursion Accepted Answers:
(unit? The ciphertext is short.
unit=124&lesso The ciphertext was encrypted with another method before encrypting with sub-stitution cipher.
n=135)
Recursion 01 7) If variable dict_name is a non-empty dictionary, what does dict name.values() re-turn? 1 point
(unit?
unit=124&lesso Returns nothing, but prints all the keys in the dictionary.
n=136) Returns a list of all the keys in the dictionary.
https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=124&assessment=523 3/5
4/15/25, 5:54 PM The Joy of Computing using Python - - Unit 9 - Week 6
unit=124&lesso Score: 1
n=141) Accepted Answers:
Both (A) and (R) are true, and (R) is the correct explanation of (A).
Week 6
Feedback 9) Which outcome generally follows from providing a proper base case in a recursive 1 point
Form: The Joy function?
of Computing
using Python The function returns a predefined result when the base condition is met.
(unit?
It prevents infinite recursion and stops when a specific codition is met.
unit=124&lesso
n=142) It ensures recursion depth is always constant.
It allows the function to keep calling itself indefinitely.
Quiz: Week 6 :
Assignment 6 Yes, the answer is correct.
(assessment? Score: 1
name=523) Accepted Answers:
The function returns a predefined result when the base condition is met.
Week 6:
It prevents infinite recursion and stops when a specific codition is met.
Programming
Assignment 1
(/noc25_cs69/p
10) In a standard 3×3 Tic-Tac-Toe board, how many distinct winning lines (rows, columns, 1 point
rogassignment or diagonals) pass through the center square?
?name=524)
3
Week 6:
2
Programming
Assignment 2 5
(/noc25_cs69/p 4
rogassignment
?name=525)
Yes, the answer is correct.
Score: 1
Week 6: Accepted Answers:
Programming 4
Assignment 3
(/noc25_cs69/p
rogassignment
?name=526)
Week 7 ()
Week 8 ()
Week 9 ()
Week 10 ()
Week 11 ()
Week 12 ()
Text
Transcripts ()
https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=124&assessment=523 4/5
4/15/25, 5:54 PM The Joy of Computing using Python - - Unit 9 - Week 6
Download
Videos ()
Books ()
Problem
Solving
Session - Jan
2025 ()
https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=124&assessment=523 5/5