Python MQP1
Python MQP1
An Autonomous Institution
Fourth Semester B.E. Degree (Autonomous) Examinations
USN: 21CSE6044
Introduction to Python
Note:
1. Part-A is mandatory.
2. Answer any five full questions from Part-B choosing at least one from each module.
3. Missing data may be suitably assumed.
PART-A
C Mark
Q.No. Question BL PO
O s
1 Is this a valid expression? Justify L2 1 2 2
'I have' + 19 + ' books.'
2 What is greedy vs Non-greedy pattern matching method L4 4 4 2
3 What is search() method and what value does it return after processing? L2 4 1 2
4 What are two ways to remove values from a list? L2 2 1 2
5 What is the difference between a function and a function call? L4 2 1 2
6 Define list with an example L2 2 1 2
7 What is the difference between the + and * character in regular L4 4 4 2
expressions
8 What does absolute and relative path mean? L2 5 6 2
What are the three “mode” arguments that can be passed to L2 5 6 2
9
the open() function?
10 How would you retrieve the value in the cell? L2 5 1 2
PART-B
Module-1
1 a) What are the different types of operators used to evaluate Boolean L2 1 1 8
expression?
b) Explain the Identifiers, Keywords, Statements, Expressions, and L2 1 6 8
Variables in Python programming language with examples.
OR
2 a) Explain the basic data types available in Python with examples. L2 1 1 8
Module-2
1|4
Q.No. Question BL CO PO Marks
3 a) Write the program for Magic 8 Ball using a List L3 2 3 8
b) Explain the program to traverse the list, and it’s different type of L2 2 1 8
operations
OR
4 a) Explain Exception handling with suitable example L2 2 1 8
Module-3
5 a) Explain Dictionaries in brief L2 3 6 8
b) Write Python code to determine whether the given string is a L3 3 3 8
Palindrome or not using slicing.
OR
6 a) Write Python program to count the total number of vowels, L3 3 3 8
consonants and blanks in a String.
b) Explain Pretty printing and Nested dictionaries L2 3 1 8
Module-4
7 a) Explain the various character classes L2 4 6 8
b) Explain the concept of finding patterns of text with and without L2 4 6 8
using regular expressions
OR
8 a) Explain the different type of pattern matching methods L2 4 4 8
b) Write a program to match the expression ^X-.*: [0-9.]+ L3 4 4 8
Module-5
9 a) Describe the characteristics of the CSV format. L2 5 1 8
b) Explain working of JSON and API’s and how to remove the L3 5 6 8
header from the files
OR
10 a) Describe the difference between Python os and os.path modules. L2 5 6 8
Also, discuss the following methods of os module
a) chdir() b) rmdir() c) walk() d) listdir() e) getcwd()
b) What are some features Excel spreadsheets have that CSV spread- L3 5 4 8
sheets don’t?
2|4