Python Programming

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Periods/

urse Categor Week


Course Title Semester C
Code y
L T P S
CGB112
PYTHON PROGRAMMING II PC 3 0 2 3 4
1
Theory
Pre- Course Learning BTL
Nil cum
requisite Type Level 4
Project
Course Objectives:

To impart the knowledge of Python programming fundamentals in building applications.

Course Outcomes:
Upon completion of the course, the students will be able to:
CO
Course Outcomes
Number
CO1 Apply the Python fundamentals to solve elementary problems.
Demonstrate the use of Control Statements and Functions for efficient program flow
CO2
and modularity.
CO3 Perform various operations in strings, list and tuple.
CO4 Demonstrate the different methods in Dictionary, Set and Regular Expression.
Integrate the knowledge of Python syntax, libraries, and frameworks in building
CO5
applications.
Syllabus
Module I Python Basics, Data Types, Expressions and Operators 9+6
Python Basic Concepts: Interactive Mode and Script Mode - Comments - Statements and
Indentation-Keywords - Identifiers and Variables - Data Types: int, float, boolean, string and
Sequence data types - Type Casting - Operators.
Self Study Topics
Using python interactive mode as a calculator - Augmented Assignment Operator
Case Study Problems
a. Write a python program to solve the expression 2+4**2/4-(5-3).
b. Program to convert the int value to float value and vice versa.
c. Program to find the average of five subject marks.
d. An employee working in a company and getting a salary of 35000, after promotion an
employee gets 10% increment. Write a python program to find the current salary.
e. Program to find maximum of three numbers
f. Python program to check data type of the given input.
Module II Control Flow and Functions 9+6
Conditional statements: if, if-else, if-elif-else- Iterative statements: While, For loop – break -
continue – pass

Approved in 14th BoS Meeting Curriculum and Syllabus | 2023 Regulation


Functions: Function Definition and Function Call – Variable scope and Lifetime – Return
Statement - Built-in Functions – Recursion – Lambda functions
Self Study Topics
Nested if-else - Common Errors in Control flow
Case Study Problems
a. Python program to print whether the given number is even or odd with user input using if
– else statement.
b. Program to determine whether the given number is positive or negative using if-elif and
else statements.
c. Python program to print counting from 1 to 10 using for loop with break statement.
d. Program to add two numbers using function by passing arguments with and without return
statement.
e. . Program to find the factorial of a number using Recursion
Module
Strings, Lists and Tuples 9+6
III
Strings: Initializing and Accessing Elements of a String - Slicing - Immutability - Built-in String
methods and functions - Concatenating - Appending and Multiplying Strings - String modules
Lists: Creation - Accessing values - Slicing - List methods - Build-in functions - List
comprehension Tuples: Creation - Operations on tuples - Traversing - Indexing and Slicing - Tuple
assignment - Build-in Functions - Immutability versus Reassignment - Unpacking tuples.
Self Study Topics
Concept of Aliasing - Difference between Assigning and Copying a List
Case Study Problems
a. Python program to calculate the length of the given string.
b. Python program to count repeated characters in a string.
c. Write a program to reverse a given string.
d. Create a List and perform following operations:
 Add an item in the 4th position of the list.
 Remove the 3rd item in the list
 Replace the 6th item with new item
 Remove the duplicate items from the list
e. Create a list and append the data of the second list to the first list
f. Write a program to find common elements between two lists
g. Write a program that removes any repeated items from a list so that each item appears at
most once. For instance, the list [2,3,4,3,0,0,5,5,9,9] would become [2,3,4,0,5,9].
h. Create a list named list1. Copy the content of the list1 to the new list named list2. See that
list2 should not reflect any changes made in the list1.
Module
Dictionaries, Set and Regular Expression 9+6
IV
Dictionaries: Basics of dictionaries - Mutability - Creation - Initializing - Accessing Elements-
Traversing a Dictionary - Dictionary Functions and methods.

Approved in 14th BoS Meeting Curriculum and Syllabus | 2023 Regulation


Set : Set Operations. Regular Expression: Basic concepts of Regular Expressions - Special
Characters - Groups of Characters and Anchors - Understanding Re Module - Important Methods
of Re Module.
Self Study Topics
Dictionary Comprehension - Immutability of Keys - Database Connectivity.
Case Study Problems
a. Python program to sort a dictionary by value
b. Python program to concatenate the following dictionaries and to create a new one
 Dict1= {1:10,2:20}
 Dict2={3:30.4:40}
c. Python program to add members to a Set
d. Python program to create a union of sets.
e. Python program that matches a string that has an ‘a’ followed by one or more b's
Module V Project Specimen 15
1. Gaming application
2. Password Generator
3. Voice Converter
Total Hours 75
Learning Resources:
Text Books
Anurag Gupta, IPS Jharkhand, GP Biswass, “ Python Programming, Problem Solving,
1 Packages and Libraries”,McGraw Hill Education(India) Private Limited, 2019 ISBN-13:978-
93-5316-800-1
“Python Programming: Using Problem Solving Approach “ by Reema Theraja, Oxford Higher
2
Education,2017.
Gowrishankar S, Veena A, “Introduction to Python Programming”, 1st Edition, CRC
3
Press/Taylor & Francis, 2018. ISBN-13: 978-0815394372
Reference Books
Jake VanderPlas, “Python Data Science Handbook: Essential Tools for Working with Data”,
1
1st Edition, O'Reilly Media, 2016. ISBN-13: 978-1491912058
Ashok NamdevKamthane,Amit Ashok Kamthane “Problem Solving and Python
2 Programming”, McGraw Hill Education(India) Private Limited, 2018 ISBN-13:978-93-5316-
137-8
Al Sweigart “AUTOMATE THE BORING STUFF WITH PYTHON” Second
3
edition,Copyright © 2015 by Al Sweigart.ISBN-13: 978-1-59327-599-0
Eric Matthes “Python Crash Course, 3rd Edition: A Hands-On, Project-Based Introduction to
4
Programming”

Approved in 14th BoS Meeting Curriculum and Syllabus | 2023 Regulation


Approved in 14th BoS Meeting Curriculum and Syllabus | 2023 Regulation

You might also like