Download GTU BE/B.Tech 2019 Summer 8th Sem New 2180711 Python Programming Question Paper

Download GTU (Gujarat Technological University) BE/BTech (Bachelor of Engineering / Bachelor of Technology) 2019 Summer 8th Sem New 2180711 Python Programming Previous Question Paper

1
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY

BE - SEMESTER ?VIII(NEW) EXAMINATION ? SUMMER 2019
Subject Code:2180711 Date:17/05/2019

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.


Q.1 (a) Write a python program that finds the factorial of a natural number n. 03
(b) Explain the concept of specification with a suitable example. 04
(c) Is String a mutable data type? Also explain the string operations length,
indexing and slicing in detail with an appropriate example.
07

Q.2 (a) Write a python program that reads a text file and changes the file by
capitalizing each character of file.
03
(b) Explain the concept of stack frame in python with an appropriate example. 04
(c) What do you mean by immutable data type? Explain immutable data types
with their operations and functions.
07
OR
(c) Write a python program that sorts the list [34, 25, 81, 12, 5] using merge sort. 07
Q.3 (a) Explain Lambda function with a suitable example. 03
(b) Explain the following python regular expression function with an example:
match() and search().
04
(c) What are bugs? Write about different types of bugs. What steps will you
perform to identify and remove the bugs in a python script?
07
OR
Q.3 (a) Explain the use of assert statement with a python program. 03
(b) Describe how aliasing creates a problem in mutable data type with an
example.
04
(c) Write a python program that creates a class Student having attributes
{Enrollement_No, Name} and methods set_data that takes the values from the
user and assigns them to attributes of the class and an operator overloading
function that converts Student object to string. Also create an Class variable
student_count that will maintain the count of Student Instances and a method
that will display this count.
07
Q.4 (a) Explain the use of following socket functions: socket(), bind() and listen(). 03
(b) Write a simple python program that draws a line graph where x = [1,2,3,4]
and y = [1,4,9,16] and gives both axis label as ?X-axis?and ?Y-axis? using
pylab.
04
(c) Write a python program that implement Caesar encryption and decryption
algorithm.
07
OR
Q.4 (a) Write a python program that shows the concept of Inheritance. 03
(b) Write a python function that displays a regular polygon of side n in turtle.
Assume that the number and length of side of regular polygon is provided by
user. Regular polygon means all sides the same lengths, all angles the same.
04
(c) Write a python program that reads a text file containing full-name of the
employees of a company and then from these names it extracts Last-name of
07
FirstRanker.com - FirstRanker's Choice
1
Seat No.: ________ Enrolment No.___________

GUJARAT TECHNOLOGICAL UNIVERSITY

BE - SEMESTER ?VIII(NEW) EXAMINATION ? SUMMER 2019
Subject Code:2180711 Date:17/05/2019

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.


Q.1 (a) Write a python program that finds the factorial of a natural number n. 03
(b) Explain the concept of specification with a suitable example. 04
(c) Is String a mutable data type? Also explain the string operations length,
indexing and slicing in detail with an appropriate example.
07

Q.2 (a) Write a python program that reads a text file and changes the file by
capitalizing each character of file.
03
(b) Explain the concept of stack frame in python with an appropriate example. 04
(c) What do you mean by immutable data type? Explain immutable data types
with their operations and functions.
07
OR
(c) Write a python program that sorts the list [34, 25, 81, 12, 5] using merge sort. 07
Q.3 (a) Explain Lambda function with a suitable example. 03
(b) Explain the following python regular expression function with an example:
match() and search().
04
(c) What are bugs? Write about different types of bugs. What steps will you
perform to identify and remove the bugs in a python script?
07
OR
Q.3 (a) Explain the use of assert statement with a python program. 03
(b) Describe how aliasing creates a problem in mutable data type with an
example.
04
(c) Write a python program that creates a class Student having attributes
{Enrollement_No, Name} and methods set_data that takes the values from the
user and assigns them to attributes of the class and an operator overloading
function that converts Student object to string. Also create an Class variable
student_count that will maintain the count of Student Instances and a method
that will display this count.
07
Q.4 (a) Explain the use of following socket functions: socket(), bind() and listen(). 03
(b) Write a simple python program that draws a line graph where x = [1,2,3,4]
and y = [1,4,9,16] and gives both axis label as ?X-axis?and ?Y-axis? using
pylab.
04
(c) Write a python program that implement Caesar encryption and decryption
algorithm.
07
OR
Q.4 (a) Write a python program that shows the concept of Inheritance. 03
(b) Write a python function that displays a regular polygon of side n in turtle.
Assume that the number and length of side of regular polygon is provided by
user. Regular polygon means all sides the same lengths, all angles the same.
04
(c) Write a python program that reads a text file containing full-name of the
employees of a company and then from these names it extracts Last-name of
07
2
employee and stores them in sorted order in new file. Input Text file contains
names in format: First-name Middle-name Last-name
Q.5 (a) Write a note on Tkinter widget: Text (Multiline text). 03
(b) Explain in detail about Grid attributes in Tkinter 04
(c) Write a TCP/IP client server chat application. 07
OR
Q.5 (a) Explain the use of following turtle functions with appropriate example: turn()
and move()
03
(b) Write a Python GUI program of window size 100*200 that displays a button
at x = 20 and y = 100 labeled as ?Click Here?. Also add a function on that
button that will create a message box having message ?Thank you for
clicking?.
04
(c) How to create a thread in python? Explain with an example. 07

*************
FirstRanker.com - FirstRanker's Choice

This post was last modified on 20 February 2020