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

Sanket
By Sanket

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

1. Which of the following methods is used to read the content of a CSV file in Python using the csv module?

  • csv.reader()
  • csv.write()
  • csv.load()
  • csv.readfile()
Answer :- For Answers Click Here 

2. Which command is used to install a Python package using pip?

  • pip install package-name
  • install pip package-name
  • python install package-name
  • pip package-name install
Answer :- For Answers Click Here 

3. What is the primary purpose of the gmplot library in Python?

  • To create 3D plots
  • To plot data on Google Maps
  • To generate matplotlib graphs
  • To create dashboards
Answer :- 

4. In a game of Snakes and Ladders, a player is currently on square 96. There is a snake on square 99 that sends the player back to square 78. If the player wishes to reach square 100 in one dice throw, what number must they roll on the dice?

Answer :- 

5. In the same scenario, where the player is on square 96 and needs to roll a 4 to reach square 100, what is the probability of rolling this number on a fair six-sided die?

  • 1/2
  • 1/3
  • 1/4
  • 1/6
Answer :- For Answers Click Here 

6.

image 39
Answer :- 

7. Does the turtle module in Python allow you to draw complex shapes on the screen?

  • Yes
  • No
Answer :- For Answers Click Here 

8. What is the purpose of the turtle.penup() and turtle.pendown() commands in Python’s turtle module?

  • To stop the turtle from drawing and then resume drawing at a new position
  • To change the color of the turtle’s pen
  • To speed up or slow down the drawing speed of the turtle
Answer :- 

9. What is the default drawing state of the turtle when a new turtle object is created in Python’s turtle module?

  • The turtle’s pen is up, so it does not draw while moving.
  • The turtle’s pen is down, so it draws while moving.
  • The turtle is hidden, so it does not appear on the screen.
  • The turtle starts with a circular shape.
Answer :- 

10. Which of the following commands is used to open an image file using Python’s PIL (Pillow) library?

  • img = PIL.Image.open(’image.jpg’)
  • img = Image.open(’image.jpg’)
  • img = open_image(’image.jpg’)
  • img = PIL.open_image(’image.jpg’)
Answer :- For Answers Click Here 
Share This Article
Leave a comment