Hello Everyone, In this article let discuss about NPTEL Joy Of Computing Using Python Week 2 Assignment 2025. For any change of answers or to know about upcoming week solutions, join the telegram for easy access.
Also Read: NPTEL week 1 answers python
To join Telegram 👉 CLICK HERE
Also Read: NPTEL JOY OF COMPUTING USING PYTHON WEEK 3 ASSIGNMENT
NPTEL Joy Of Computing Using Python Week 2 Assignment 2025
Last Date To Submit 05-02-2025
Q1. 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.
Answer: [ B ] False, the variable stores the value from the latest assignment.
Q2. Which of the following code blocks print - ”Ramesh talks to Suresh and Kamlesh” ?
A. print ("Ramesh talks to Suresh and Kamlesh")
B. print ("Ramesh talks to" + "Suresh" + " and", "Kamlesh")
C. print ("Ramesh talks to Suresh", "and", " Kamlesh")
D. print ("Ramesh talks to" + " Suresh and Kamlesh")
Answer: [ A, B, C ]
The Output is
Q3. 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)
Answer: [ A, C, D ]
Q4. The following program outputs 723 -
def mystery(container):res=[ ]for i in range(len(container)):if i%2 !=0:result.appppend(container[i]*4)else:result.append(container[i]*(-1))
return result {codeBox}
For what value of a does the code output 123 ?
A. 1
B. 2
C. 6
D. 5
Answer: [ C ] 6
Q5. What does 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 the a multiples of a starting from 1 and adds 3.
Answer: [ C ] Calculates the factorial of a-1+3
Q6. 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
Answer: [ B ] for loop
Q7. 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 the program from the lines after the if/while block.
C. Python interpreter executes the if/while blocks, and rest of the program.
D. Python interpreter executes the if/while, and the programs runs in an infinite loop.
Answer: [ B ] Python interpreter ignores the if/while blocks, and proceeds the program from the lines after the if/while block.
Q8. The following program might/might not have an infinite loop. Does the program have infinite loop ?
A. No, the program doesn’t have 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.
Answer: [ D ]
Q9. For which of the following values of name and age variables does the following code print ”You are lucky”?
A. aryan, 20
B. arjun, 19
C. aakash, 16
D. anand, 18
Answer: [ A ] [ D ]
Q10. For which of the options among the previous question, the program doesn’t print anything.
A. aryan, 20
B. aakash, 16
C. arjun, 19
D. anand, 18
Answer: [ B ] aakash, 16
Conclusion:
If any queries related to Assignment, join telegram 👉 CLICK HERE
The answers for week 3 assignment 👇
Also Read: NPTEL JOY OF COMPUTING USING PYTHON WEEK 3 ASSIGNMENT