Course Objectives:
CLO 1.Demonstrate the use of IDLE or PyCharm IDE to create Python Applications
CLO 2. Using Python programming language to develop programs for solving real-world problems
CLO 3. Implement the Object-Oriented Programming concepts in Python.
CLO 4. Appraise the need for working with various documents like Excel, PDF, Word and Others
CLO 5. Demonstrate regular expression using python programming
Note: two hours tutorial is suggested for each laboratory sessions.
Prerequisite
PART A – List of problems for which student should develop program and execute in the Laboratory
Aim: Introduce the Python fundamentals, data types, operators, flow control and exception handling in Python
1
a) Write a python program to find the best of two test average marks out of three test’s marks accepted from the user.
b) Develop a Python program to check whether a given number is palindrome or not and also count the number of occurrences of each digit in the input number.
Datatypes: https://www.youtube.com/watch?v=gCCVsvgR2KU Operators: https://www.youtube.com/watch?v=v5MR5JnKcZI Flow Control: https://www.youtube.com/watch?v=PqFKRqpHrjw For loop: https://www.youtube.com/watch?v=0ZvaDa8eT5s While loop: https://www.youtube.com/watch?v=HZARImviDxg Exceptions: https://www.youtube.com/watch?v=6SPDvPK38tw
Aim: Demonstrating creation of functions, passing parameters and return values
2.
a) Defined as a function F as Fn = Fn-1 + Fn-2. Write a Python program which accepts a value for N (where N >0) as input and pass this value to the function. Display suitable error message if the condition for input value is not followed.
b) Develop a python program to convert binary to decimal, octal to hexadecimal using functions.
Functions: https://www.youtube.com/watch?v=BVfCWuca9nw
Arguments: https://www.youtube.com/watch?v=ijXMGpoMkhQ
Return value: https://www.youtube.com/watch?v=nuNXiEDnM44
Aim: Demonstration of manipulation of strings using string methods
3.
a) Write a Python program that accepts a sentence and find the number of words, digits, uppercase letters and lowercase letters.
b) Write a Python program to find the string similarity between two given strings Sample Output: Original string: Python Exercises Python Exercises Similarity between two said strings: 1.0 Sample Output: Original string: Python Exercises Python Exercise Similarity between two said strings: 0.967741935483871
Strings: https://www.youtube.com/watch?v=lSItwlnF0eU
String functions: https://www.youtube.com/watch?v=9a3CxJyTq00
Aim: Discuss different collections like list, tuple and dictionary
4.
a) Write a python program to implement insertion sort and merge sort using lists
b) Write a program to convert roman numbers in to integer values using dictionaries.
Lists: https://www.youtube.com/watch?v=Eaz5e6M8tL4
List methods: https://www.youtube.com/watch?v=8-RDVWGktuI
Tuples: https://www.youtube.com/watch?v=bdS4dHIJGBc
Tuple operations: https://www.youtube.com/watch?v=TItKabcTTQ4
Dictionary: https://www.youtube.com/watch?v=4Q0pW8XBOkc
Dictionary methods: https://www.youtube.com/watch?v=oLeNHuORpNY
Aim: Demonstration of pattern recognition with and without using regular expressions
5.
a) Write a function called isphonenumber () to recognize a pattern 415-555-4242 without using regular expression and also write the code to recognize the same pattern using regular expression.
b) Develop a python program that could search the text in a file for phone numbers (+919900889977) and email addresses (sample@gmail.com)
Regular expressions: https://www.youtube.com/watch?v=LnzFnZfHLS4
Aim: Demonstration of reading, writing and organizing files.
6.
a) Write a python program to accept a file name from the user and perform the following operations
1. Display the first N line of the file
2. Find the frequency of occurrence of the word accepted from the user in the file
b) Write a python program to create a ZIP file of a particular folder which contains several files inside it. Files: https://www.youtube.com/watch?v=vuyb7CxZgbU https://www.youtube.com/watch?v=FqcjKewJTQ0 File organization: https://www.youtube.com/watch?v=MRuq3SRXses
Aim: Demonstration of the concepts of classes, methods, objects and inheritance
7.
a) By using the concept of inheritance write a python program to find the area of triangle, circle and rectangle.
b) Write a python program by creating a class called Employee to store the details of Name, Employee_ID, Department and Salary, and implement a method to update salary of employees belonging to a given department.
OOP’s concepts: https://www.youtube.com/watch?v=qiSCMNBIP2g Inheritance: https://www.youtube.com/watch?v=Cn7AkDb4pIU
Aim: Demonstration of classes and methods with polymorphism and overriding
8.
a) Write a python program to find the whether the given input is palindrome or not (for both string and integer) using the concept of polymorphism and inheritance.
Overriding: https://www.youtube.com/watch?v=CcTzTuIsoFk
Aim: Demonstration of working with excel spreadsheets and web scraping
9.
a) Write a python program to download the all XKCD comics
b) Demonstrate python program to read the data from the spreadsheet and write the data in to the spreadsheet
Web scraping: https://www.youtube.com/watch?v=ng2o98k983k Excel: https://www.youtube.com/watch?v=nsKNPHJ9iPc
Aim: Demonstration of working with PDF, word and JSON files
10.
a) Write a python program to combine select pages from many PDFs
b) Write a python program to fetch current weather data from the JSON file
PDFs: https://www.youtube.com/watch?v=q70xzDG6nls
https://www.youtube.com/watch?v=JhQVD7Y1bsA
https://www.youtube.com/watch?v=FcrW-ESdY-A
Word files: https://www.youtube.com/watch?v=ZU3cSl51jWE
JSON files: https://www.youtube.com/watch?v=9N6a-VLBa2I
Python (Full Course): https://www.youtube.com/watch?v=_uQrJ0TkZlc
Pedagogy For the above experiments the following pedagogy can be considered. Problem based learning, Active learning, MOOC, Chalk &Talk
PART B – Practical Based Learning
A problem statement for each batch is to be generated in consultation with the co-examiner and student should develop an algorithm, program and execute the program for the given problem with appropriate outputs.
Course Outcomes:
CO 1. Demonstrate proficiency in handling of loops and creation of functions.
CO 2. Identify the methods to create and manipulate lists, tuples and dictionaries.
CO 3. Discover the commonly used operations involving regular expressions and file system.
CO 4. Interpret the concepts of Object-Oriented Programming as used in Python.
CO 5. Determine the need for scraping websites and working with PDF, JSON and other file formats.
Assessment Details (both CIE and SEE)
Continuous Internal Evaluation (CIE):
CIE marks for the practical course is 50 Marks.
The split-up of CIE marks for record/ journal and test are in the ratio 60:40.
The Sum of scaled-down marks scored in the report write-up/journal and average marks of two tests is the total CIE marks scored by the student.
Semester End Evaluation (SEE):
Rubrics suggested in Annexure-II of Regulation book
Textbooks:
1. Al Sweigart, “Automate the Boring Stuff with Python”,1stEdition, No Starch Press, 2015. (Available under CC-BY-NC-SA license at https://automatetheboringstuff.com/)
2. Reema Thareja “Python Programming Using Problem Solving Approach” Oxford University Press.
3. Allen B. Downey, “Think Python: How to Think Like a Computer Scientist”, 2nd Edition, Green Tea Press, 2015. (Available under CC-BY-NC license at http://greenteapress.com/thinkpython2/thinkpython2.pdf)