Student Name: Title: Iot-Course-Assessment - 2 Department: Year / Sec: Date

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

Student Name: Title: IoT-Course-Assessment - 2

Department: Year / Sec:


Date :

1. What is the output of the following?


print("Hello {name1} and {name2}".format(name1='foo', name2='bin'))
a) Hello foo and bin b) Hello {name1} and {name2}
c) Error d) Hello and
Answer:
2. All keywords in Python are in
a) lower case b) UPPER CASE
c) Capitalized d) None of the mentioned
Answer:
3. Which of these in not a core datatype?
a) Lists b) Dictionary
c) Tuples d) Class
Answer :
4. Carefully observe the code and give the answer.
def example(a):
a = a + '2'
a = a*2
return a
>>>example("hello")
Answer:
5. What data type is the object below?
L = [1, 23, ‘hello’, 1].
a) list b) dictionary
c) array d) tuple
Answer:
6. What is the output of the below program?
def printMax(a, b):
if a > b:
print(a, 'is maximum')
elif a == b:
print(a, 'is equal to', b)
else:
print(b, 'is maximum')
printMax(3, 4)
a) 3 b) 4
c) 4 is maximum d) None of the mentioned
Answer:
7. _____ is used to create an object.
a) class b) constructor
c) User-defined functions d) In-built functions
Answer:
8. What is the output of the below program?
x = 50
def func(x):
print('x is', x)
x=2
print('Changed local x to', x)
func(x)
print('x is now', x)
a) x is now 50 b) x is now 2
c) x is now 100 d) None of the mentioned
Answer:
9. Which of the following operator in python evaluates to true if it does not finds a
variable in the specified sequence and false otherwise?
A - ** B - //
C – is D - not in
Answer:
10. Raspberry-Pi is a ________________
A) Micro- Computer B) Nano- Computer
C) Mega -Computer D) Mini-Computer
Answer: D
11. What is the Size of RAM for Raspberry-Pi Model 3
A) 256 MB B) 512 KB
C) 512 MB D) 1 GB
Answer:
12. How to access IO Pins as per GPIO Configure through Python
A) GPIO.setmode(GPIO.BOARD) B) GPIO.setmode(GPIO.BCM)
C) GPIO.setmode(GPIO) D) GPIO.setmode(GPIO;BCM)
Answer:
13. Library used for accessing Raspberry pi GPIO
A) import RPI.GPIO as gpio B) import RPi.GPIO as gpio
C) import RPI.GPIO as GPIO D) import RPi.gpio as GPIO
Answer:
14. How to assign input pin for raspberry pi using python?
A) GPIO.setup(4, GPIO.IN) B) GPIO.setmode(4, GPIO.IN)
C) GPIO.setup(4, GPIO.INPUT) D) GPIO.setup(4, gpio.IN)
Answer:
15. How many pins are there in ultrasonic sensor HC-SR04 to interface with
microcontroller?
A) 3 B) 4
C) 5 D) 2
Answer:
16. What is the range of IPv6 addresses?
A) 2^256 B) 2^64
C) 2^32 D) 2^128
Answer:
17. MQTT stands for _____________
a) MQ Telemetry Things b) MQ Transport Telemetry
c) MQ Transport Things d) MQ Telemetry Transport
Answer:

18. MQTT is _________ protocol.


a) Machine to Machine b) Internet of Things
c) Machine to Machine and Internet of Things d) Machine Things
View Answer
Answer:

19. Which protocol is lightweight?


a) MQTT b) HTTP
c) CoAP d) SPI
Answer:

20. What is NodeMCU Module?


a)WIFI module b)Sensor
c) Bluetooth Board d) USB cable

Answer:
21. Standard ports of MQTT are __________
a) I2C b) SSL
c) USART d) TCP/IP
Answer:
22. In a Publish/Subscribe model publish doesn’t know who is subscribing.

a. True b. False

Answer:

23. An QTT broker can use any port, but by default it uses port 1883?

a. True b. False

Answer:

24. MQTT transmits data to and from a broker in which format.

a)Binary b)Text based


c) ASCHII d) None of the above

Answer:

25. Which not one of the features of IoT?

a. remotely controllable b.programmable

c.can turn themselves off if necessary d.all are features

Ans:

26. How many digital I/O pins are there in arduino Uno?
A) 13 B)14
C) 5 D) 40
Answer:

26. What is this line of code:


// the loop function runs over and over again forever
(A) A statement (B) A single line comment
(C) A function definition (D) A bowl of cereal

Ans:
27. What is this line of code:
void loop() {
(A) A statement (B) A single line comment
(C) Part of a function definition (D) A banana
Ans:
28. delay(5000); stands for
a) wait 5 minutes b) wait 5 seconds
c) wait 50 seconds d)wait 5000 seconds
Ans:
29. What is wrong with the following:
int led = 13;
void setup() { 
pinMode(led, INPUT); 
}
void loop() { 
digitalWrite(led, HIGH); 
delay(1000);
digitalWrite(led, LOW); 
delay(1000);
}
Ans:
30.Baud rate is
a) Symbol or signal per seconds b) bits per seconds
c) Byte per seconds d) None of the above
Ans:

You might also like