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

Sanket
By Sanket

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

1. Which of the following is the correct way to add data with key as CS101 and value as “Web Programming” to a dictionary named courseData?

  • courseData[“CS101”].append(“Web Programming”)
  • courseData[“CS101”][“Web Programming”]
  • courseData[“CS101”] = “Web Programming”;
  • courseData[“CS101”] = “Web Programming”
Answer :- For Answers Click Here 

2. What is the probability of Monty opening the door with goat, given the hypothesis that you initially chose the door which has car ?

  • 0.5
  • 0.66
  • 0.33
  • 1
Answer :- For Answers Click Here 

3. What should be replaced with ? in line 10, so that there is high chance that final_choice is equal to 2 ?

Image Question 3
  • True
  • (290) % 2 == 0
  • 3((389) + 3 ) % 3 == 0
  • (2*90 ) % len(doors) == 1
Answer :- For Answers Click Here 

4. Given that you have a sorted list of 1024 elemets, what is the maximum number of comparisons required to find the target element using binary search ? Also what is the number of comparisons to search such an element using linear search ?

  • Binary: 10, Linear: 512
  • Binary: 11, Linear: 1024
  • Binary: 10, Linear: 1024
  • Binary: 11, Linear: 512
Answer :- 

5. What type of data is contained in a file with a .wav or .wave extension?

  • Log data
  • Audio data
  • Video data
  • Image data
Answer :- 

6. What does this program print in the end ?

Image Question 6
  • Fraction of throws where both players showed different symbol(rock/paper/scissors)
  • Fraction of throws where both players showed rock.
  • Fraction of throws where both players showed same symbol(rock/paper/scissors)
  • Fraction of throws where both players showed paper.
Answer :- For Answers Click Here 

7. In binary search, what happens if the target value is greater than the middle element of the array?

  • The search continues in the left half of the array.
  • The search continues in the right half of the array.
  • The search ends.
  • The array is sorted again.
Answer :- 

8. Which of the following is a requirement for binary search to work correctly?

  • The list must be sorted.
  • The list must contain only positive numbers.
  • The list must be of an even length.
  • The list must contain unique elements.
Answer :- 

9. Given an array [5, 3, 8, 4, 2], what will be the array after the third pass of Bubble Sort?

  • [3, 2, 4, 8, 5]
  • [3, 2, 4, 5, 8]
  • [2, 3, 4, 5, 8]
  • [3, 5, 2, 4, 8]
Answer :- 

10. How many swaps are performed in iteration 3 for bubble sorting list [4,3,2,1]? Enter 0 if the list is sorted in less than 3 iterations.

Answer :- For Answers Click Here 
Share This Article
Leave a comment