imp py
imp py
1. Q.2 (a) What is the Structure and Behavior of a “while Loop”? Explain with an example.
2. Q.2 (b) Write a program that accepts the lengths of three sides of a triangle as inputs. The program
output should indicate whether or not the triangle is a right triangle.
3. Q.2 (c) Write a python script to Convert Decimal number to Binary number.
4. Q.3 (a) Discuss Boolean Functions with examples.
5. Q.2 (a) What is the Structure and Behavior of a “while Loop”? Explain with an example.
6. Q.2 (b) Write a program that accepts the lengths of three sides of a triangle as inputs. The program
output should indicate whether or not the triangle is a right triangle.
7. Q.2 (c) Write a python script to Convert Decimal number to Binary number.
8. Q.3 (a) Discuss Boolean Functions with examples.
9. Q.3 (a) Explain for loop in detail.
10.
11. Q.3 (c) Make use of if, if..else, if..elif..else, and nested if.
OR
12. Q.3 (a) Explain while loop in detail.
13. Q.3 (b) Develop a Python program to print the factorial of a number.
14. Q.3 (c) Explain the working of break, continue, and pass statements.
1. Q.3 (b) Define a function named even. This function expects a number as an argument and returns
True if the number is divisible by 2, or it returns False otherwise.
2. Q.3 (c) Write a Python function to calculate the factorial of a number (a nonnegative integer). The
function accepts the number as an argument.
3. Q.4 (a) Discuss in brief python “Dictionaries” with examples.
4. Q.4 (b) Assume that the variable data refers to the dictionary {'b':20, 'a':35}. Write the values of the
following expressions:
○ a. data['a']
○ b. data.get('c', None)
○ c. len(data)
○ d. data.keys()
5. Q.4 (c) Write a Python function that checks whether a passed string is palindrome or not.
6. Q.3 (b) Define a function named even. This function expects a number as an argument and returns
True if the number is divisible by 2, or it returns False otherwise.
7. Q.3 (c) Write a Python function to calculate the factorial of a number (a nonnegative integer). The
function accepts the number as an argument.
8. Q.4 (a) Discuss in brief python “Dictionaries” with examples.
9. Q.4 (b) Assume that the variable data refers to the dictionary {'b':20, 'a':35}. Write the values of the
following expressions:
○ a. data['a']
○ b. data.get('c', None)
○ c. len(data)
○ d. data.keys()
10. Q.4 (c) Write a Python function that checks whether a passed string is palindrome or not.
11. Q.4 (a) Differentiate actual and formal arguments.
12. Q.4 (b) Develop a Python program to display the Fibonacci sequence using the recursion method.
13. Q.4 (c) Develop a Python program that converts decimal to binary, decimal to octal, and decimal to
hexadecimal numbers using user-defined functions.
OR
14. Q.4 (a) Define SCOPE, and discuss global and local variables in detail.
15. Q.4 (b) Define Lambda function, and utilize it in an example.
16. Q.4 (c) Develop a Python program to find the maximum, minimum, and average of given numbers
using user-defined functions.
Ch 5: MicroPython
1. Q.5 (b) What are the differences between Python and MicroPython?
2. Q.6 (b) Discuss the steps of Installation of MicroPython on Hardware.
3. Q.7 (a) Explain the following functions of MicroPython:
3. uart.read(5)
4. pwm0.freq(1000)
5. wlan.scan()
4. Q.7 (b) Write a MicroPython script to blink the LED pin connected to GPIO digital pins 1 to 4 of
ESP8266 continuously.
5. Q.7 (c) Write a MicroPython script to read PIR sensor data for an ESP8266. If the value is high, print
“Motion detected”; otherwise, print “Motion Stopped.”
6. Q.8 (a) Explain steps in MicroPython to connect ESP module’s WiFi.
7. Q.8 (b) Write a MicroPython program: if Button is Connected with Pin number 1 of ESP8266, when
the button is pressed, toggle the LEDs connected to pins 2 and 3.
8. Q.8 (c) Write a MicroPython script to read and print DHT Sensor data for ESP8266 continuously.
9. Q.5 (b) What are the differences between Python and MicroPython?
10. Q.6 (b) Discuss the steps of Installation of MicroPython on Hardware.
11. Q.7 (a) Explain the following functions of MicroPython:
3. uart.read(5)
4. pwm0.freq(1000)
5. wlan.scan()
12. Q.7 (b) Write a MicroPython script to blink the LED pin connected to GPIO digital pins 1 to 4 of
ESP8266 continuously.
13. Q.7 (c) Write a MicroPython script to read PIR sensor data for an ESP8266. If the value is high, print
“Motion detected”; otherwise, print “Motion Stopped.”
14. Q.8 (a) Explain steps in MicroPython to connect ESP module’s WiFi.
15. Q.8 (b) Write a MicroPython program: if Button is Connected with Pin number 1 of ESP8266, when
the button is pressed, toggle the LEDs connected to pins 2 and 3.
16. Q.8 (c) Write a MicroPython script to read and print DHT Sensor data for ESP8266 continuously.
17. Q.5 (a) Define MicroPython, and explain its features.
OR
18. Q.5 (b) Develop a program in MicroPython to send digital data to a GPIO pin of a
MicroPython-supported board and blink an LED connected to it