0% found this document useful (0 votes)
51 views2 pages

Gujarat Technological University

Uploaded by

bhvnghh
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)
51 views2 pages

Gujarat Technological University

Uploaded by

bhvnghh
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/ 2

Seat No.: ________ Enrolment No.

___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–V (NEW) EXAMINATION – WINTER 2023
Subject Code:3151108 Date:05-12-2023
Subject Name:Python Programming
Time:10:30 AM TO 01:00 PM Total Marks:70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
Simple and non-programmable scientific calculators are allowed.

MARKS
Q.1 (a) Describe membership operator and identity operator with 03
example.
(b) Write Python program to find sum of first N numbers using while 04
loop. (Take N as user input)
(c) Differentiate List, Tuple, Set and Dictionary. 07

Q.2 (a) Describe following list methods with example. 03


(1) append( ) (2) insert( ) (3) discard( )
(b) Describe for loop with example. 04
(c) Write Python code to print following pattern using nested loop. 07
1
01
101
0101
10101
Take Number of row as user input.
OR
(c) Write Python code to find determinant of 3x3 Matrix. Enter 9 data 07
run time.

Q.3 (a) Describe python tuple with example. Describe any two built-in 03
tuple methods
(b) Describe filter method/function available in python with example. 04
(c) Write a python program to read marks of students from 07
“student_marks.csv”. Find average, maximum, and minimum
marks from data. (File contains 100 records)
OR
Q.3 (a) Describe different methods to make dictionary variable. 03
(b) Enlist different modes of opening file. Describe any three method 04
with example
(c) Write a program to print 100 fibonacci numbers in file 07
“Myfibonnaci.csv”

Q.4 (a) Enlist types of plot available in python matplotlib module. 03


(b) Describe python function with keyworded variable length 04
argument with example.

1
(c) Write following python functions: 07
Function-1: Returns reverse string word wise.
Function-2: Count occurrence of vowels from input string.
Design Main python code where above functions are called.
OR
Q.4 (a) Enlist python operators which results in Boolean output. Explain 03
with example.
(b) Enlist python errors. Describe try-except block with example. 04
(c) Write a python program to find roots of following quadratic 07
equation and plot it.
y = 3x2 -5x - 4
in the range of -5 to 5 on plot. Put axes label and plot title.

Q.5 (a) Enlist various tools available to program MicroPython. 03


(b) Describe lambda function with two examples. 04
(c) Sketch circuit diagram to interface 8-LEDs with GPIO of CPU* 07
Write MicroPython program to blink LEDs in ring counter pattern.

CPU* : Microcontroller board which supports Micropython


Programming.
OR
Q.5 (a) Describe merits and demerits of Micropython over python. 03
(b) Describe Modules in python. 04
(c) Sketch circuit diagram to interface 16x2 LCD with CPU* 07
Write MicroPython program to display “Python Programming” on
first line of LCD.

CPU* : Microcontroller board which supports Micropython


Programming.

*************

You might also like