Seat No.: ________ Enrolment No.
___________
GUJARAT TECHNOLOGICAL UNIVERSITY
BE - SEMESTER–V (NEW) EXAMINATION – WINTER 2021
Subject Code:3151108 Date:15/12/2021
Subject Name:Python Programming
Time:02:30 PM TO 05: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) Define Python? List the important features of python. 03
(b) What is tuple ? What is the difference between list and tuple? 04
(c) Write short note on different types of operators in python with appropriate 07
example.
Q.2 (a) What is a function? Mention the type of function and use. 03
(b) What is len function and explain how it is used on strings with an example. 04
(c) What is Data Type? Explain various data types used in Python. 07
OR
(c) Write a python program to check if a string is palindrome or not. 07
Q.3 (a) What is the use of str.upper() and str.lower() functions in string? 03
(b) What are Python's dictionaries? Explain how to create a dictionary in python? 04
(c) Explain following List methods in python with appropriate example. 07
a) append() b) insert() c) remove() d) clear() e) reverse()
OR
Q.3 (a) What is meant by module in python? . List some built in modules in python. 03
(b) Explain break and continue statement in python? 04
(c) What is an exception? Explain about the different types of Exceptions in 07
Python.
Q.4 (a) Explain string comparison with an example. 03
(b) Which method is used to read the contents of a file which is already created? 04
(c) Write a program to enter a number in Python and print its octal and hexadecimal 07
equivalent
OR
Q.4 (a) What are negative indexes and why are they used? 03
(b) What is the difference between = = and is operator in Python? 04
(c) Write a python program to find the factorial of any number. 07
Q.5 (a) Write the syntax and usage of WHILE and FOR loop. 03
(b) Give difference between Micro Python and Python. 04
(c) Explain all file processing modes supported in Python. 07
OR
Q.5 (a) What is micro python? Discuss unique features of micro python. 03
(b) How does del operation work on dictionaries? Give an example. 04
(c) Write program in MicroPython to send digital data on GPIO pins of NodeMCU 07
and glow LED connected with NodeMCU or any other MicroPython supported
board.