Python Assignment 2
Python Assignment 2
Course Outcomes:
Course Outcomes:
CO 1. Examine Python syntax and semantics and be fluent in the use of Python flow
control and functions.
CO 2. Demonstrate proficiency in handling Strings and File Systems.
CO3: Create, run and manipulate Python Programs using core data structures like Lists,
Dictionaries and use Regular Expressions.
Cogni Course
Q. Mark
Question tive Outcom
No. s
Level es
a. Write the python code to display the last six characters of the string
Cr 3 CO2
“Make hay while the sun shines “ to the console. (3M- June 2018)
b. Write a python program to accept a file name from the user. (7M-
June 2018, July 2019)
1
i. Display the first N line of the file.
Cr 07 CO2
ii. Find the frequency of occurrence of the word accepted from the
user in the file.
Write a python program to Phone Number and Email Address Extractor
that do following functions
a. Create two regexes, one for matching phone numbers and the other
2 Cr 10 CO3
for matching email addresses.
b. Find All Matches in the Clipboard Text
c. Join the Matches into a String for the Clipboard
6 b. List any six methods associated with strings and explain each of them
with an example. (05 Marks, July 2019) U 5 CO2
a. List merits of dictionary over list. How tuples can be used as keys in
dictionaries. Write a python program to accept USN and marks obtained,
find maximum, minimum and students USN who have scored in the range Cr 7 CO3
10 100-85,85-75, 75-60 and below 60 marks separately. (8M- Jan
2019, 06 M -Dec/Jan2020)
b. write a python program to search lines that start with ‘F” followed by 2 Cr 4 CO3
characters, followed by ‘m:’