Nptel The Joy of Computing Using Python Week 2 Assignment Answers

Searching for the Week 2 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 2 assignment with confidence.

Nptel The Joy of Computing Using Python Week 2 Assignment Answers
Nptel The Joy of Computing Using Python

The Joy of Computing using Python

ABOUT THE COURSE :

A fun filled whirlwind tour of 30 hrs, covering everything you need to know to fall in love with the most sought after skill of the 21st century. The course brings programming to your desk with anecdotes, analogies and illustrious examples. Turning abstractions to insights and engineering to art, the course focuses primarily to inspire the learner’s mind to think logically and arrive at a solution programmatically. As part of the course, you will be learning how to practice and culture the art of programming with Python as a language. At the end of the course, we introduce some of the current advances in computing to motivate the enthusiastic learner to pursue further directions.

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 !!
Unlocking the fundamentals of The Joy of Computing using Python, the NPTEL Week 2 assignment is designed to introduce learners to the core concepts of this powerful object-oriented language. From understanding Python’s syntax and structure to writing simple programs, this week lays the foundation for a deeper journey into Python development. In this post, we provide clear and concise solutions to the Week 2 assignment, ensuring clarity for beginners while adhering to academic integrity and learning goals. Dive in to reinforce your concepts and validate your approach.
Get All Week Nptel Assignment Answers – Click Here

Nptel The Joy of Computing Using Python Week 2 Assignment Answers

  1. Statement: If a variable is assigned a value once, the value in the variable cannot be changed in the variable.
    a. False, the variable stores all values it was assigned.
    b. False, the variable stores the value from the latest assignment.
    c. True, the variable stores only the value from the second-last assignment.
    d. True, the variable stores value from the initial assignment only.

View Answer


  1. Which of the following code blocks prints – “Ramesh talks to Suresh and Kamlesh”?
    a. print(j'Ramesh talks to Suresh and Kamlesh" + and")
    b. print("Ramesh talks to " "Suresh" " Kamlesh")
    c. print("Ramesh talks to Suresh" " and " " Kamlesh ")
    d. print("Ramesh talks to" "Suresh and Kamlesh")

View Answer


  1. What aren’t the correct ways to inform Python that input is a decimal point number?
    a. in(input())
    b. float(input())
    c. int(input())
    d.
a = input()  
a = int(a)

View Answer


  1. The following program outputs 723.
def mystery(container):
    result = []
    for i in range(len(container)):
        result.append(i)
    else:
        result.append(len(container))
    return result

For what value of a does the code output 123?
a. 1
b. 2
c. 6
d. 5

View Answer

For Latest Update Join our official channel: Click here to join


  1. What does the previous question calculate?
    a. Calculates the factorial of a.
    b. Calculates the factorial of a-1 and adds 3.
    c. Calculates the factorial of a-1+3.
    d. Calculates a multiples of a starting from 1 and adds 3.

View Answer


  1. Which loop is used to perform a set of repetitive tasks without a condition by default in Python?
    a. while loop
    b. for loop
    c. do-while loop
    d. while-range loop

View Answer


  1. What happens when the condition inside the if and while evaluate to false?
    a. Python interpreter ignores the if/while blocks and halts the program.
    b. Python interpreter ignores the if/while blocks and proceeds with the program from the lines after the if/while block.
    c. Python interpreter executes the if/while blocks and the rest of the program.
    d. Python interpreter executes the if/while blocks, and the program runs in an infinite loop.

View Answer


  1. The following program might/might not have an infinite loop. Does the program have an infinite loop?
while True:
    a.append(n % 10)
    a.sort()
    for i in a:
        if (b < k):
            print("FUN")
        else:
            print("IS BORING")

a. No, the program doesn’t have an infinite loop.
b. Yes, it can be prevented by updating the value of a before the if block at line 3.
c. Yes, it can be prevented by removing both the if blocks inside the while loop.
d. Yes, but it cannot be prevented.

View Answer

For Latest Update Join our official channel: Click here to join


  1. For which of the following values of name and age variables does the following code print ‘You are lucky’?
name = input("Enter your name: ")
age = int(input("Enter your age: "))
flag = False
if age > 18:
    flag = True
counter = 0
for i in name:
    counter += 1
if flag and (counter % 2 == 0):
    print("You are lucky")
else:
    print("You are not lucky")

a. aryan, 20
b. arjun, 19
c. aakash, 16
d. anand, 18

View Answer


  1. For which of the options from the previous question does the program not print anything?
    a. aryan, 20
    b. aakash, 16
    c. arjun, 19
    d. anand, 18

View Answer

Nptel The Joy Of Computing Using Python Week 3 Assignment Answers – Click Here