Assignment-W6
Assignment-W6
Introduction to
Internet of Things
Assignment-Week 6
TYPE OF QUESTION:MCQ/MSQ
QUESTION 1:
a. True
b. False
QUESTION 2:
a. True
b. False
Detailed Solution: Adafruit provides a library to work with DHT22 Sensor. (Please refer to
lecture Implementation of IoT with Raspberry Pi- II @ 4:41)
QUESTION 3:
a) 5
b) 12
c) Code
d) &Code
Detailed Solution:
1. x = [4, 5, 6]: A list with three elements.
2. y = [str(x[0] + 1), str(len(x) * 2) + '&Code']:
o x[0] is 4, so x[0] + 1 is 5, and str(x[0] + 1) becomes "5".
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
QUESTION 4:
Statement: “To indicate different blocks of code, Python follows rigid indentation.”
a. True
b. False
Detailed Solution: To indicate different blocks of code, Python follows rigid indentation.
QUESTION 5:
QUESTION 6:
During remote server access by a Raspberry Pi, where the Raspberry Pi acts as a client,
the client needs the following?
d. Client’s IP address
Detailed Solution: A client can communicate with a server only if both IP address and
port numbers are known. (Please refer Lecture 31@14:13)
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
QUESTION 7:
State whether the following command to install the PIL library is correct or not.
a. Correct
b. Incorrect
Detailed Solution: The command to install the PIL library is sudo pip install pillow.
QUESTION 8:
What is the purpose of the "w" mode in the open() function in Python?
A) To read a file
B) To write data to a file, overwriting existing content
C) To append data to a file
D) To open a file in read and write mode
Detailed Solution: “w” mode is used to write data to a file, overwriting existing content
QUESTION 9:
What will be the output of the given Python program when reading from the file?
A) Writing data
B) Reading from the file
Writing data
C) Error: File not found
D) None of the above
Writing data
Writing data
QUESTION 10:
a. Yes
b. No
QUESTION 11:
Which command is used to configure the Raspberry Pi for the camera module?
A) sudo camera-config
B) sudo raspi-config
C) sudo enable-camera
D) sudo pi-setup
Detailed Solution: sudo raspi-config is used to configure the Raspberry Pi for the
camera module
QUESTION 12:
What is the final step after enabling the camera in the Raspberry Pi configuration?
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Detailed Solution: after enabling the camera in the Raspberry Pi configuration, reboot.
See lecture IMPLEMENTATION OF IOT WITH RASPBERRY PI-II @ 18:44
QUESTION 13:
a. Ctrl + X
b. Ctrl + O
c. Ctrl + K
d. None of these
QUESTION 14:
In a temperature-controlled fan system using a relay, when should the fan turn on?
NPTEL Online Certification Courses
Indian Institute of Technology Kharagpur
Detailed Solution: In a temperature-controlled fan system using a relay, the fand should turn on
when the surrounding temperature exceeds a predefined threshold.
QUESTION 15:
raspistillcapture -o image.jpg
************END***********