The Joy of Computing using Python Week 3 NPTEL Assignment Answers 2025

Need help with this week’s assignment? Get detailed and trusted solutions for The Joy of Computing using Python Week 3 NPTEL Assignment Answers. Our expert-curated answers help you solve your assignments faster while deepening your conceptual clarity.

✅ Subject: The Joy of Computing using Python
📅 Week: 3
🎯 Session: NPTEL 2025 July-October
🔗 Course Link: Click Here
🔍 Reliability: Verified and expert-reviewed answers
📌 Trusted By: 5000+ Students

For complete and in-depth solutions to all weekly assignments, check out 👉 NPTEL The Joy of Computing using Python Week 3 NPTEL Assignment Answers

🚀 Stay ahead in your NPTEL journey with fresh, updated solutions every week!

NPTEL The Joy of Computing using Python Week 3 Assignment Answers 2025

1. What is the correct way for Satish to start an empty list to record names?

  • list = ()
  • list = {}
  • list = []
  • list = <>
Answer : See Answers

2. Satish wants to add “Anya” to his homework list. Which method should he use?

  • list.add(“Anya”)
  • list.push(“Anya”)
  • list.insert(“Anya”)
  • list.append(“Anya”)
Answer :

3. If Satish’s list is [“Ravi”, “Tina”, “Aman”], what will list[0] return?

  • “Tina”
  • “Aman”
  • “Ravi”
  • 0
Answer :

4. To remove “Tina” from the list, Satish should use:

  • list.delete(“Tina”)
  • list.remove(“Tina”)
  • list.pop(“Tina”)
  • list.cut(“Tina”)
Answer :

5. Satish wants to correct a spelling mistake and replace “Ravi” with “Ravindra” at position 0 in the list students.
Which of the following code snippets will accomplish this?

  • students[0] = “Ravindra”
  • students[0:1] = [“Ravindra”]
  • students.insert(0, “Ravindra”)
  • students.replace(“Ravi”, “Ravindra”)
Answer :

6. If list1 = [“Ravi”, “Anya”] and list2 = [“Tina”], what does list1 + list2 return?

  • [“RaviAnyaTina”]
  • [“Ravi”, “Anya”, “Tina”]
  • [“Tina”, “Ravi”, “Anya”]
  • Error
Answer :

7. What will be the result of [“Aman”] * 3?

  • [“Aman3”]
  • [“Aman”, “Aman”, “Aman”]
  • [“Aman3”, “Aman3”, “Aman3”]
  • Error
Answer : See Answers

8. If students = [“Ravi”, “Anya”, “Tina”, “Aman”, “Neha”], what does students[1:4] return?

  • [“Ravi”, “Anya”, “Tina”, “Aman”]
  • [“Anya”, “Tina”, “Aman”]
  • [“Tina”, “Aman”, “Neha”]
  • [“Anya”, “Tina”, “Aman”, “Neha”]
Answer :

9. Given students = [“Ravi”, “Anya”, “Tina”, “Aman”, “Neha”], what does students[-2:] return?

  • [“Tina”, “Aman”]
  • [“Aman”, “Neha”]
  • [“Neha”]
  • Error
Answer :

10. If students = [“Ravi”, “Anya”, “Tina”, “Aman”, “Neha”, “Kabir”], what does students[::2] return?

  • [“Ravi”, “Tina”, “Neha”]
  • [“Anya”, “Aman”, “Kabir”]
  • [“Ravi”, “Anya”, “Kabir”]
  • [“Ravi”, “Tina”, “Aman”, “Kabir”]
Answer :

11. Satish creates a backup like this:

What could explain why both submissions and backup seem to have 3 items now?

  • Satish created a reference, not a real copy.
  • The backup was overwritten by append().
  • backup and submissions point to the same list in memory.
  • The append() affected only submissions, not backup.
Answer :

12.

How does this change affect the original and backup lists?

  • backup[0] still holds “Ravi”.
  • Slicing created a new list with separate memory.
  • Changing submissions[0] also updates backup[0].
  • Both lists still refer to the same object.
Answer :

13.

What might Satish notice wrt the above code ?

  • The backup also shows “ZIP” for Ravi.
  • Changing the submissions list also changes the backup.
  • The backup list changed because backup and submissions both point to the same list in memory.
  • The change only applies to submissions, not backup.
Answer : See Answers

14. Satish tries slicing again with nested lists:

What unexpected behavior might confuse Satish?

  • The backup also shows “ZIP” instead of “DOC”.
  • Slicing didn’t protect inner lists from being shared.
  • The backup list is completely unrelated to the original.
  • Only the outer list was copied, not the inner lists.
Answer :

15. Satish makes a backup and modifies it:

What is the final state of both lists?

  • submissions has 2 items.
  • backup has 3 items.
  • “Neha” appears in both lists.
  • The original list was also updated with “Neha”.
Answer :

16. Satish creates two sublists using the same variable:

What will submissions look like?

  • [[“Ravi”, “PDF”], [“Ravi”]]
  • [[“Ravi”, “PDF”], [“Ravi”, “PDF”]]
  • [[“PDF”], [“PDF”]]
  • [[“Ravi”], [“Ravi”, “PDF”]]
Answer :

17. Satish updates the backup list thinking it’s separate from the original:

What will be the value of submissions[0]?

  • “Ravi”
  • [“Ravi”]
  • “Neha”
  • It raises an error
Answer :

18. Satish tries this slice:

What is the value of backup?

  • [“Aman”, “Tina”]
  • [“Tina”]
  • []
  • It raises an error
Answer :

19. Satish modifies the backup reference like this:

What is the final value of submissions?

  • [“Aman”]
  • [“Ravi”, “Tina”]
  • []
  • [“Ravi”]
Answer : See Answers

20. Satish slices a list of lists and modifies the first sublist:

What is the value of group2[0]?

  • [“Ravi”]
  • [“Submitted”]
  • [“Ravi”, “Submitted”]
  • It raises an error
Answer :

21. Suppose names = [“Ravi”, “Anya”] and meals = [“Idli”, “Poha”]. What will the following expression do?

  • It pairs each name with a corresponding meal
  • It changes the original names and meals lists
  • It creates a sequence of grouped elements
  • It returns a list of values from the second list only
Answer :

22. Which of the following advantages of enumerate() are clearly mentioned or shown in the comprehension?

  • Automatically gives both index and value
  • Helps avoid using range(len(…))
  • Returns reversed values
  • Removes duplicate items from the list
Answer :

23. Which of the following best describes a scenario where using map() would be preferred over a for loop?

  • When you want to pair student names with their meals
  • When you want to display items along with their serial numbers
  • When you want to apply a calculation to every item in a list without modifying the original
  • When you want to remove all non-vegetarian meals from a list
Answer :

24. What will be the output of the following code?

  • [(‘Ravi’, ‘Idli’), (‘Anya’, ‘Poha’), (‘Sita’, ‘Dosa’)]
  • [(‘Amit’, ‘Idli’), (‘Anya’, ‘Poha’), (‘Sita’, ‘Dosa’)]
  • [(‘Amit’, ‘Poha’), (‘Anya’, ‘Dosa’)]
  • [(‘Amit’, ‘Poha’), (‘Sita’, ‘Dosa’)]
Answer :

25. What is the output of this code?

  • [‘Idli’, ‘Poha’, ‘Dosa’]
  • [‘IDLI’, ‘POHA’, ‘DOSA’]
  • [‘IDLI’, ‘Poha’, ‘Dosa’]
  • [‘Idli’, ‘POHA’, ‘DOSA’]
Answer : See Answers

26. Predict the output:

  • [118.0, 236.0]
  • [118.0, 354.0]
  • [100, 300]
  • [118, 300]
Answer :

27. What will the following code return?

  • 0
  • 1
  • 2
  • 3
Answer :

28. What will be the final content of new_prices?

  • [118.0, 177.0]
  • [118.0, 354.0]
  • [118.0, 177.0, 236.0]
  • [118.0, 300.0]
Answer :

29. What will be printed?

  • [15, 25, 35]
  • [10, 20, 30]
  • [10, 25, 30]
  • Error
Answer :

30. Choose the correct output:

  • abc
  • [‘a1’, ‘b1’, ‘c1’]
  • a1b1c1
  • Error
Answer : See Answers

NPTEL The Joy of Computing using Python Week 3 Assignment Answers 2024

1. Consider the following code snippet:

What does the code do?
Options:
(a) Takes a list of numbers as input, appends each number to a list, and prints the list of numbers
(b) Takes a list of elements as input, appends each element to a list, and prints the list of elements
(c) Takes the count of elements followed by the same number of elements as input, appends each element to a list, and prints the list of elements
(d) Takes the count of elements, appends each element to a list, and prints the count of elements entered.

Answer :- b ✅
Explanation: The code likely loops through a sequence of inputs and appends them to a list, regardless of type (numbers, strings), which matches option (b).


2. Which of the following statements are true about List Data Structure? [MSQ]

Options:
(a) It is a flexible Data Structure
(b) Elements could be added to a list
(c) Elements could be subtracted from a list
(d) This_is_not_List = [ ] is an empty list

Answer :- a, b, c, d ✅
Explanation: All statements are correct. Python lists are dynamic, support adding/subtracting elements, and [] creates an empty list.


3. What does the above code print?

Options:
(a) Amar, Akbar, Anthony
(b) amar is brother of anthony and akbar
(c) Amar is brother of Anthony and Akbar
(d) Anthony is brother of Akbar and Amar

Answer :- d
Explanation: The print order in the code is likely print(anthony, akbar, amar) format, thus matching option (d).


4. What does the code do?

Options:
(a) Takes a list of numbers, multiplies each number by 2, and prints the updated list
(b) Takes a list of numbers, appends each number to the list twice, and prints the updated list
(c) Takes a list of numbers, removes even numbers from the list, and prints the updated list
(d) Takes a list of numbers, divides each number by 2, and prints the updated list

Answer :- a
Explanation: Code most likely uses list comprehension or a loop to double each element.


5. What will be the output of the following Python code?

Options:
(a) “1111111111”
(b) “0000000000”
(c) A string with some 1s and some 0s
(d) The function will raise an error

Answer :- c
Explanation: The output depends on logic that randomly assigns 0 or 1 based on a condition, so (c) is correct.


6. What does the code do?

Options:
(a) Takes a list of numbers as input, computes the sum of the numbers, and prints the sum along with the average
(b) Takes the count of elements, computes the sum of the elements, and prints the sum along with the average
(c) Takes a list of numbers as input, computes the average of the numbers, and prints the average along with the sum
(d) None of the above

Answer :- a
Explanation: Code computes both sum and average, and prints them — typical input-processing-output format.


7. What will be the output of the following Python code?

Options:
(a) “Python”
(b) A random permutation of the letters in “python”
(c) “random”
(d) The function will raise an error

Answer :- b ✅
Explanation: Likely uses random.shuffle() or similar function to randomly rearrange the characters of “python”.


8. What does the code do? [MSQ]

Options:
(a) Reverses the numbers list and stores it in new_numbers.
(b) Creates an empty list named new_numbers and appends elements from numbers to it in reverse order.
(c) Produces an error due to an invalid function used for list manipulation.
(d) Generates a new list new_numbers with elements from numbers in the same order as numbers.

Answer :- b
Explanation: The logic describes manually reversing a list using a loop and appending elements in reverse order.


9. Which of the following are examples of Social Computing/Crowd Computing: [MSQ]

Options:
(a) Wikipedia
(b) Stack Exchange
(c) Quora
(d) Facebook

Answer :- a, b, c
Explanation: Wikipedia, Stack Exchange, and Quora rely on user-generated content and collaboration. Facebook is more social networking, not primarily crowd computing.


10. What does the code do?

Options:
(a) Prints numbers from 1 to 20, replacing multiples of 3 with “Fizz”, multiples of 5 with “Buzz”, and multiples of both 3 and 5 with “FizzBuzz”.
(b) Prints numbers from 1 to 20, replacing multiples of 3 and 5 with “FizzBuzz”, multiples of 3 with “Fizz”, and multiples of 5 with “Buzz”.
(c) Prints numbers from 1 to 20, replacing multiples of 3 with “Fizz”, multiples of 5 with “Buzz”, and numbers divisible by both 3 and 5 with their product.
(d) Prints numbers from 1 to 20, replacing multiples of 3 with “Buzz”, multiples of 5 with “Fizz”, and numbers divisible by both 3 and 5 with “FizzBuzz”.

Answer :- b
Explanation: Standard FizzBuzz logic where 15 is replaced with “FizzBuzz”, 3 with “Fizz”, 5 with “Buzz”.