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

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

1. Consider the following code snippet:

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:

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:

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?

• “1111111111”
• “0000000000”
• A string with some 1s and some 0s
• The function will raise an error
`Answer :- `

6. Consider the following code snippet:

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?

• “Python”
• A random permutation of the letters in “python”
• “random”
• The function will raise an error
`Answer :- `

8. Consider the following code snippet:

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
`Answer :- `
`Answer :- For Answer Click Here `