0% found this document useful (0 votes)
3 views6 pages

NPTEL Week6 MCQ

The document contains 25 multiple-choice questions (MCQs) related to Python programming and IoT concepts. Topics covered include Python data types, functions, file operations, Raspberry Pi usage, and sensor functionalities. It serves as a study guide for understanding key IoT and Python programming principles.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views6 pages

NPTEL Week6 MCQ

The document contains 25 multiple-choice questions (MCQs) related to Python programming and IoT concepts. Topics covered include Python data types, functions, file operations, Raspberry Pi usage, and sensor functionalities. It serves as a study guide for understanding key IoT and Python programming principles.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

NPTEL IoT - Week 6: Important 25 MCQs

1. What makes Python ideal for IoT?

A) Strict syntax

B) Closed-source nature

C) Easy scripting and hardware interfacing

D) Limited data types

2. Which is NOT a valid Python data type?

A) List

B) Tuple

C) Dictionary

D) Block

3. In Python, what denotes a block of code?

A) Curly braces

B) Tabs

C) Semicolons

D) Indentation

4. How do you define a function in Python?

A) function()

B) func()

C) def

D) declare

5. Which statement is used to handle exceptions in Python?

A) error

B) try-except

C) catch
NPTEL IoT - Week 6: Important 25 MCQs

D) except-else

6. What does the 'input()' function do?

A) Prints data

B) Accepts user input

C) Runs a loop

D) Defines a function

7. What is the correct way to import a module in Python?

A) use module

B) include module

C) import module

D) exec module

8. What does the 'with' keyword ensure in file operations?

A) File isn't written

B) Automatic closing of file

C) Disables editing

D) Adds comments

9. Which module is used for CSV operations in Python?

A) os

B) sys

C) csv

D) pandas

10. Which function is used to open a file in Python?

A) create()

B) load()
NPTEL IoT - Week 6: Important 25 MCQs

C) open()

D) file()

11. What command installs Pillow for image processing?

A) sudo apt install PIL

B) pip install image

C) sudo pip install pillow

D) sudo apt install img

12. Which function is used to rotate an image?

A) image.turn()

B) image.rotate()

C) image.flip()

D) image.move()

13. Which object reads an image file in Python?

A) open()

B) PIL.Image

C) Image.open()

D) cv2.open()

14. What is the function of sockets in networking?

A) Display output

B) Manage loops

C) Enable network communication

D) Store files

15. Which function sends data over a socket?

A) socket.write()
NPTEL IoT - Week 6: Important 25 MCQs

B) socket.send()

C) socket.output()

D) socket.transmit()

16. What is Raspberry Pi primarily used for?

A) Game development

B) Home automation and prototyping

C) Data entry

D) Video editing

17. Which GPIO pin mode is used for output in Raspberry Pi?

A) GPIO.OUT

B) GPIO.IN

C) GPIO.SIGNAL

D) GPIO.DATA

18. What OS is officially supported by Raspberry Pi?

A) Fedora

B) Kali Linux

C) Raspbian

D) Android

19. What language is pre-installed on Raspberry Pi?

A) Assembly

B) Kotlin

C) Python

D) Swift

20. What device does a DHT sensor read?


NPTEL IoT - Week 6: Important 25 MCQs

A) Motion

B) Light

C) Temperature & Humidity

D) Voltage

21. What is a relay used for in IoT systems?

A) Send signals

B) Switch devices on/off

C) Increase voltage

D) Record data

22. What is the GPIO function to clean up all used pins?

A) GPIO.shutdown()

B) GPIO.clear()

C) GPIO.cleanup()

D) GPIO.exit()

23. Which Python library is used with the Pi Camera?

A) camlib

B) PiVideo

C) picamera

D) imaging

24. What command is used to capture an image using raspistill?

A) raspistill -c image.jpg

B) raspistill -o image.jpg

C) picamera -s image.jpg

D) camclick -i image.jpg
NPTEL IoT - Week 6: Important 25 MCQs

25. What is the function of Adafruit_DHT library?

A) LED blinking

B) Display graphics

C) Interact with temperature sensor

D) Play audio

You might also like