Nptel The Joy of Computing Using Python Week 6 Assignment Answers
Searching for the Week 6 answers of the Nptel The Joy of Computing Using Python course? You’re in the right spot! Here, you’ll find reliable and up-to-date solutions to help you complete your Week 6 assignment with confidence.

The Joy of Computing using Python
ABOUT THE COURSE :
INTENDED AUDIENCE : Any interested audience
PREREQUISITES : 10th standard/high school
INDUSTRY SUPPORT : Every software company is aware of the potential of a first course in computer science. Especially of a first course in computing, done right.
COURSE LAYOUT – Click To Know More
- Motivation for Computing
- Welcome to Programming!!
- Variables and Expressions : Design your own calculator
- Loops and Conditionals : Hopscotch once again
- Lists, Tuples and Conditionals : Lets go on a trip
- Abstraction Everywhere : Apps in your phone
- Counting Candies : Crowd to the rescue
- Birthday Paradox : Find your twin
- Google Translate : Speak in any Language
- Currency Converter : Count your foreign trip expenses
- Monte Hall : 3 doors and a twist
- Sorting : Arrange the books
- Searching : Find in seconds
- Substitution Cipher : What’s the secret !!
- Sentiment Analysis : Analyse your Facebook data
- 20 questions game : I can read your mind
- Permutations : Jumbled Words
- Spot the similarities : Dobble game
- Count the words : Hundreds, Thousands or Millions.
- Rock, Paper and Scissor : Cheating not allowed !!
- Lie detector : No lies, only TRUTH
- Calculation of the Area : Don’t measure.
- Six degrees of separation : Meet your favourites
- Image Processing : Fun with images
- Tic tac toe : Let’s play
- Snakes and Ladders : Down the memory lane.
- Recursion : Tower of Hanoi
- Page Rank : How Google Works !!
Nptel The Joy of Computing Using Python Week 6 Assignment Answers
Que. 1 If nn is a positive integer, what is the output of the function given input nn?
def mystery(n):
if n <= 0:
return 0
return n + mystery(n - 1)
a) Sum of numbers from 1 to nn
b) Sum of numbers from 1 to n−1n-1
c) n−1n-1
d) nn
View Answer
Que. 2 Assertion (A): If a recursive function doesn’t have a base case, it may never stop.
Reason (R): Recursion means that a function calls itself.
a) Both (A) and (R) are true, and (R) is the correct explanation of (A).
b) Both (A) and (R) are true, but (R) is not the correct explanation of (A).
c) (A) is true, but (R) is false.
d) (A) is false, but (R) is true.
View Answer
Que. 3 What is the output of the following code?
def func(x):
return x ** 2
def func(x, y=1):
return x**2 + y
print(func(5))
a) Error
b) 25
c) 26
d) 5
View Answer
Que. 4 In English, the letter ‘z’ usually appears far less often than most letters. Now imagine applying a Substitution Cipher to a large body of English text, where ‘z’ is replaced by ‘r’, and every other letter is also mapped to a unique letter. After encryption, which letter is likely to be the least frequent in the new text?
a) z
b) r
c) e
d) It is not possible to determine
View Answer
For Latest Update Join our official channel: Click here to join
Que. 5 If you have a large ciphertext produced by a simple substitution cipher on an English text, can you determine the original message by examining how often each letter appears?
a) Yes, it can be done.
b) No, it cannot be done.
View Answer
Que. 6 Suppose you suspect that a piece of ciphertext was produced using a simple substitution cipher. Under which circumstances might frequency analysis fail to yield accurate results?
a) The ciphertext is short.
b) The ciphertext was encrypted with another method before encrypting with substitution cipher.
c) The ciphertext is very long.
View Answer
Que. 7 If variable dict_name
is a non-empty dictionary, what does dict_name.values()
return?
a) Returns nothing, but prints all the keys in the dictionary.
b) Returns a list of all the keys in the dictionary.
c) Returns a list of all the values in the dictionary.
d) Returns a list of all the items in the dictionary.
View Answer
Que. 8 Assertion (A): A Caesar Cipher is a type of Substitution Cipher.
Reason (R): In a Caesar Cipher, each letter in the plaintext is replaced by a letter at a fixed shift in the alphabet.
a) Both (A) and (R) are true, and (R) is the correct explanation of (A).
b) Both (A) and (R) are true, but (R) is not the correct explanation of (A).
c) (A) is true, but (R) is false.
d) (A) is false, but (R) is true.
View Answer
For Latest Update Join our official channel: Click here to join
Que. 9 Which outcome generally follows from providing a proper base case in a recursive function?
a) The function returns a predefined result when the base condition is met.
b) It prevents infinite recursion and stops when a specific condition is met.
c) It ensures recursion depth is always constant.
d) It allows the function to keep calling itself indefinitely.
View Answer
Que. 10 In a standard 3×3 Tic-Tac-Toe board, how many distinct winning lines (rows, columns, or diagonals) pass through the center square?
a) 3
b) 2
c) 5
d) 4
View Answer
Nptel The Joy Of Computing Using Python Week 7 Assignment Answers – Click Here