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

Sanket
By Sanket

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

1. Which of the following is a valid way to create a tuple in Python?

  • t = [1, 2, 3]
  • t = (1, 2, 3)
  • t = {1, 2, 3}
  • t = 1, 2, 3
Answer :- For Answers Click Here 

2. Which of the following operations is valid on a tuple?

  • t[1] = 4
  • t.append(4)
  • t = t + (4,)
  • del t[1]
Answer :- For Answers Click Here 

3. What will the following code output?

t = [1, 2, 3]
print(type((t,t)))

image 87
Answer :- For Answers Click Here 

4. What is the primary purpose of the matplotlib.pyplot module in Python?

  • To perform matrix operations.
  • To handle file I/O operations.
  • To generate and customize visualizations like plots and graphs.
  • To manipulate and process images.
Answer :- 

5. Which of the following statements is true about anagrams?

  • Two strings of different lengths can be anagrams.
  • Two strings are anagrams if they contain the same characters in the same order.
  • Two strings are anagrams if they contain the same characters in different orders.
Answer :- 

6. Every character, whether an alphabet, digit, or special character, has an ASCII value. Which of the following methods is used to find the ASCII value ?

  • ASCII(’a’)
  • ord(’a’)
  • int(’a’)
  • ASC val(’a’)
Answer :- For Answers Click Here 

7. Which of the following libraries is commonly used to determine the intensity of emotions in sentiment analysis?

  • VADER
  • Numpy
  • Pandas
  • SciPy
Answer :- 

8. Which of the following Python code snippets correctly checks if two strings are anagrams?

image 88
Answer :- a

9. Why is gambling generally a bad decision ?

  • Because you will lose more money than you win over time.
  • Because the probability of winning is always 0.
  • Because you will always win.
  • Because the amount of money you can win is always greater than the amount you lost over time
Answer :- 

10. True or False: A significant amount of information can be extracted from an image by applying the appropriate image enhancement techniques

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