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

Join Our WhatsApp Group Join Now
Join Us On Telegram Join Now

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

1. Consider the following code snippet:

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

What does the code do?

  • Takes a list of numbers as input, appends each number to a list, and prints the list of numbers
  • Takes a list of elements as input, appends each element to a list, and prints the list of elements
  • 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
  • Takes the count of elements, appends each element to a list, and prints the count of elements entered.
Answer :- For Answer Click Here 

2. Data Structure is a way by which you can organize/arrange your data. Which of the following statements are true about List Data Structure: [MSQ]

  • It is a flexible Data Structure
  • Elements could be added to a list.
  • Elements could be subtracted from a list.
  • This_is_not_List = [ ] is an empty list
Answer :- For Answer Click Here 

3. Consider the following code snippet:

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

What does the above code print?

  • Amar, Akbar, Anthony
  • amar is brother of anthony and akbar
  • Amar is brother of Anthony and Akbar
  • Anthony is brother of Akbar and Amar
Answer :- For Answer Click Here 

4. Consider the following code snippet:

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

What does the code do?

  • Takes a list of numbers, multiplies each number by 2, and prints the updated list
  • Takes a list of numbers, appends each number to the list twice, and prints the updated list
  • Takes a list of numbers, removes even numbers from the list, and prints the updated list
  • Takes a list of numbers, divides each number by 2, and prints the updated list
Answer :- 

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

NPTEL The Joy of Computing using Python Week 3 Assignment Answers 2024
  • “1111111111”
  • “0000000000”
  • A string with some 1s and some 0s
  • The function will raise an error
Answer :- 

6. Consider the following code snippet:

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

What does the code do?

  • Takes a list of numbers as input, computes the sum of the numbers, and prints the sum along with the average
  • Takes the count of elements, computes the sum of the elements, and prints the sum along with the average
  • Takes a list of numbers as input, computes the average of the numbers, and prints the average along with the sum
  • None of the above
Answer :- For Answer Click Here 

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

NPTEL The Joy of Computing using Python Week 3 Assignment Answers 2024
  • “Python”
  • A random permutation of the letters in “python”
  • “random”
  • The function will raise an error
Answer :- 

8. Consider the following code snippet:

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

What does the code do? [MSQ]

  • Reverses the numbers list and stores it in new_numbers.
  • Creates an empty list named new_numbers and appends elements from numbers to it in reverse order.
  • Produces an error due to an invalid function used for list manipulation.
  • Generates a new list new_numbers with elements from numbers in the same order as numbers.
Answer :- 

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

  • Wikipedia
  • Stack Exchange
  • Quora
  • Facebook
Answer :- 

10. Consider the following code snippet:

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

What does the code do?

  • 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”.
  • 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”.
  • 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.
  • 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 :- For Answer Click Here