Seat No.: ________ Enrolment No.
___________
GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTER–VII (NEW) EXAMINATION – WINTER 2021
Subject Code:3171716 Date:29/12/2021
Subject Name:Python For Engineers
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.
4. Simple and non-programmable scientific calculators are allowed.
MARKS
Q.1 (a) What is Python? What can Python do? What are the features of 03
Python?
(b) What is the Difference between Python and C Language? 04
(c) Write a Hello World Program in Python. 07
Q.2 (a) Explain arithmetic operators in Python. 03
(b) Explain bitwise operators in Python. 04
(c) Explain about following data types in Python with example. 07
1. String
2. List
3. Tuple
4. Dictionary
OR
(c) Explain Python assignment operators with example. 07
Q.3 (a) Explain logical operators in Python with example. 03
(b) Explain about below Python keywords. 04
1. Print
2. class
3. global
(c) How we can define a function in Python? Explain with example. 07
OR
Q.3 (a) Give the details of loops available in Python. 03
(b) Explain about Identity operators in Python with example. 04
(c) Explain Python comparison operators with example. 07
Q.4 (a) What is the difference between global variable and local variable? 03
(b) Write a Python program which accepts the radius of a circle from 04
the user and computes the area.
(c) Write a Python program to test whether a number is within 100 of 07
1000 or 2000.
OR
Q.4 (a) What is the meaning of MODULES in Python? 03
(b) Write a Python program which accepts a sequence of comma- 04
separated numbers from the user and generate a list and a tuple with
those numbers.
(c) Write a Python program to find whether a given number (accept 07
from the user) is even or odd, print out an appropriate message to
the user.
Q.5 (a) Write a Python program that accepts an integer (n) and computes 03
the value of n+nn+nnn.
(b) Write a Python program to solve (x + y) * (x + y). 04
1
Test Data : x = 4, y = 3
Expected Output : ((4 + 3) ^ 2) = 49
(c) Write a Python program to convert seconds(accept from the user) to 07
day, hour, minutes and seconds.
OR
Q.5 (a) Write a Python program that will accept the base and height of a 03
triangle and compute the area.
(b) Write a Python program to sum of the first n positive integers. 04
(c) Write a Python program to convert pressure in pascals(accept from 07
user) to pounds per square inch, a millimeter of mercury (mmHg)
and bar.
Hint :
1 bar = 100000 Pascal
1 Pascal = 0.0001450377 pounds per square inch
1 millimeter of mercury (mmHg) = 133.322 Pascal
*************