Download GTU B.Tech 2020 Winter 5th Sem 3151108 Python Programming Question Paper

Download GTU (Gujarat Technological University Ahmedabad) B.Tech/BE (Bachelor of Technology/ Bachelor of Engineering) 2020 Winter 5th Sem 3151108 Python Programming Previous Question Paper

Seat No.: ________
Enrolment No.___________
GUJARAT TECHNOLOGICAL UNIVERSITY
BE- SEMESTER?V (NEW) EXAMINATION ? WINTER 2020
Subject Code:3151108 Date:22/01/2021
Subject Name:Python Programming
Time:10:30 AM TO 12:30 PM Total Marks: 56
Instructions:
1. Attempt any FOUR questions out of EIGHT questions.

2. Make suitable assumptions wherever necessary.

3. Figures to the right indicate full marks.


Marks
Q.1 (a) Briefly explain Data types and Variable in Python.
03

(b) Write a program that calculates and prints the number of minutes in a year.
04

(c) Discuss following Python's operators: Arithmetic, Assignment, Comparison,
07
Logical with suitable examples.


Q.2 (a) What is The Structure and Behavior of a "while Loop" explain with example.
03

(b) Write a program that accepts the lengths of three sides of a triangle as inputs. The
04
program output should indicate whether or not the triangle is a right triangle.

(c) Write a python script to Convert Decimal number to Binary number
07
Q.3 (a) Discuss Boolean Functions with examples.
03

(b) Define a function named even. This function expects a number as an argument and
04
returns True if the number is divisible by 2, or it returns False otherwise.

(c) Write a Python function to calculate the factorial of a number (a non-
07
negative integer). The function accepts the number as an argument




Q.4 (a) Discuss in brief python "Dictionaries" with example
03

(b) Assume that the variable data refers to the dictionary {'b':20, 'a':35}. Write the
04
values of the following expressions:
a. data['a'] b. data.get('c', None) c. len(data) d. data.keys()

(c) Write a Python function that checks whether a passed string is palindrome or
07
not
Q.5 (a) Discuss common functions for accessing files
03

(b) what are the differences between python and Micro python
04

(c) Write a Python program to copy the contents of a file to another file
07



Q.6 (a) How to read CSV file in python explain with example.
03

(b) Discus the steps of Installation of MicroPython on Hardware
04

(c) Write a python program to find the longest words in a read file.
07
Q.7 (a) Explain following fucntions of micropython:
03
1. uart.read(5); 2. pwm0.freq(1000) 3. wlan.scan()

(b) Write a micropython script to Blink led pin connected to GPIO digital pin 1
04
to 4 of ESP8266 continuously.

(c) Write a micropython script to read PIR sensor data for an ESP8266. If value
07
is high print "Motion detected" otherwise print "Motion Stopped".



Q.8 (a) Explain steps in micropython to connect esp module's wifi.
03
(b) Write a micro python program: if Button is Connected with Pin number 1 of
04
ESP8266. When button is pressed toggle the leds connected to pin number 2
and 3.
(c) Write a micropython script to read and print DHT Sensor data for ESP8266
07
continuously.
*********
1

This post was last modified on 04 March 2021