Government of Karnataka
DEPARTMENT OF COLLEGIATE AND TECHNICAL EDUCATION
Programme Cyber Physical Systems & Security Semester III
Course Code 20CY31P Type of Course Programme Core
8 hours/week
Course Name Python Programming Contact Hours
104 hours/semester
Teaching
L:T:P :: 3:1:4 Credits 6
Scheme
CIE Marks 60 SEE Marks 40
1. Rationale
Computer programming is the core of the computer science and strong fundamentals of programming can
give competitive edge in this technology driven world. It not only instils coding skills but also enhances
problem solving ability. Python is one of the programming languages which is versatile and feature rich yet
simple and easy to learn, has applications in various domains. Python programming sets the basis for further
study of web development, data science, IoT, machine learning etc.
2. Course Outcomes: At the end of the Course, the student will be able to:
Install the latest version of python distribution and configure it for an appropriate workspace
CO-01
as needed for a given project.
Write a program by selecting python constructs needed to solve a given problem and then code,
CO-02
execute, test and debug the program to obtain the desired result.
CO-03 Demonstrate how a program can be optimized by using modular programming approach.
CO-04 Identify and resolve both syntactical and semantic errors in a given code snippet.
3. Course Content
Tutorial
Lecture Practice
(Activity
(Knowledge Criteria) (Performance Criteria)
Criteria)
Week CO PO
4 hours/week (2
1
3 hours/week hours/batch twice in a
hour/week
week)
Fundamental Concepts:
brief history; features; applications of
python; python distributions;
1. Setup python
versions; python IDEs; Python
environment
interpreter;
2. Executing python:
Execution of python programs,
1 1,2 1,4 explore different
debugging python code; Indentation,
ways to run python
Comments; best practices for python
program
programming;
3. debug python code
Character set; tokens; keywords,
variables, naming rules for variables,
Refer Table 1
Assignment,
Basics I/O operations
1. Code, execute and
Input- input (), raw_input() ;
2 2,4 1,2,4 debug programs that
output – print (), formatting output.
Datatypes a) Use i/o statements
Department of Collegiate and Technical Education, Government of Karnataka 4
Scalar type: Numeric (int, long, float, b) Evaluate expressions
complex), Boolean, bytes, None; Type and displays
casting formatted output
Operators c) Evaluate expressions
Arithmetic, Comparison/Relational, to examine the
Logical/Boolean, Bitwise; string operator precedence
operators; Expressions and operator
precedence 2. Identify and resolve
syntactic and
semantic issues in the
given code snippet
1. Identify and Code,
execute and debug
programs using
Control Flow: Conditional blocks
conditional
If statement: general format;
3 2,4 1,2,4 statements.
Multiway branching; Sufficient
2. Identify and resolve
examples;
syntactic and
semantic issues in the
given code snippet
1. Code, execute and
debug programs
using loops.
Control Flow: Loops
2. Code, execute and
While loop: general format; examples
debug programs
For loop: general format, examples.
using loops and
4 2,4 1,2,4 Range();nesting loops and conditional
conditional
statements;
statements
Controlling loop execution: Break,
3. Identify and resolve
continue, pass statements;
syntactic and
semantic issues in the
given code snippet
1. Code, execute and
debug programs to
perform following
Data Collections ▪ set operations
Concept of mutability ▪ set
Set – features, declaration, comprehension
initialization, operations, 2. Code, execute and
comprehension; debug programs to
5 2,4 1,2,4 Tuple-features; declaration, perform following
initialization, basic operations; ▪ basic operations
indexing; slicing; built in functions; on tuples
Nested tuples; ▪ tuple indexing
and slicing
3. Identify and resolve
syntactic and
semantic issues in the
given code snippet
List
1. Write code snippet to
features; declaration, initialization,
perform following on
basic operations; indexing;
List
List iterations; Slicing; built in
6 2,4 1,2,4 ▪ basic operations
functions; Nested Lists;
on List
Comprehensions; Applications
▪ indexing and
slicing
▪ comprehension
Department of Collegiate and Technical Education, Government of Karnataka 5
2. Identify and resolve
syntactic and
semantic issues in the
given code snippet
1. Code, execute and
debug programs to
perform basic
operations on
Dictionary Dictionary
features; declaration, initialization, 2. Code, execute and
basic operations; indexing; debug programs to
7 2,4 1,2,4 adding and removing keys, iterating perform Dictionary
through dictionaries; built in indexing
functions; Comprehensions; Iterating
Applications comprehension
3. Identify and resolve
syntactic and
semantic issues in the
given code snippet
1. Code, execute and
debug programs to
perform string
Arrays and Strings manipulation
Arrays: features; create, initialize, 2. Code, execute and
8 2,4 1,2,4 indexing, traversal, manipulation; debug programs to
Strings: create, assign, indexing, built perform array
in functions; manipulation
3. Identify and resolve
syntactic and
semantic issues in the
given code snippet
1. Code, execute and
debug programs to
solve the given
problem using built in
functions
2. Code, execute and
debug programs to
solve the given
Functions
problem by defining a
Need of function; types; define
function
function, calling function, function 3. Code, execute and
9 2,3,4 1,2,4 arguments; return and yield; None debug programs to
keyword; Scope of variables; solve the given
Recursion; anonymous functions; problem using
sufficient examples; recursion
4. Define anonymous
function and code to
solve the given
problem
5. Identify and resolve
syntactic and
semantic issues in the
given code snippet
1. Create Modules and
10 2,3,4 1,2,4 Modules and Packages Packages
Department of Collegiate and Technical Education, Government of Karnataka 6
Why modules? Module creation; 2. Code, execute and
Importing modules; Module debug programs
Namespace; using built in
Packages: basics; path setting; modules
Package init .py Files;
Commonly used modules: Math,
random; Emoji;
1. Code, execute and
debug programs
NumPy using NumPy module.
Brief about NumPy module; NumPy 2. Code, execute and
arithmetic functions; NumPy array debug programs
manipulation functions; NumPy using series.
11 2,3,4 1,2,4 statistical functions; 3. Code, execute and
Pandas debug programs
Introduction, series, data frame; using dataframes.
Create dataframes; formatting data; 4. Identify and resolve
fundamental data frame operations; syntactic and
semantic issues in the
given code snippet
1. write code snippet to
perform following
operations on
different types of files
Files ▪ read file
Concept; features; file operations; ▪ write to file.
2. Write code to
Opening Files; Closing Files; Writing
12 2,3,4 1,2,4 perform file
to Files; operations using
Reading to Files; File methods; dataframes on
Working with files using data frame. different file types.
3. Identify and resolve
syntactic and
semantic issues in the
given code snippet
1. Integrate exception
handling into above
Error and Exception Handling:
code
Python errors; exceptions: built in,
2. Write code snippet to
user defined. How to catch
13 2,3,4 1,2,4 raise exceptions
exceptions?
3. Identify and resolve
Raising exceptions;
syntactic and
semantic issues in the
given code snippet
Total in hours 39 13 52
*PO = Program outcome as listed and defined in year 1 curriculum
Table 1: Suggestive activities for tutorials (the list is only shared as an example and not inclusive of all
possible activities for that course. Student and faculty are encouraged to choose activities that are relevant to
the topic and the availability of such resources at their institution)
Sl no Activity
1. Compare and contrast excel and python
1
2. Identify various python IDEs and identify differences between them.
1. Identify use cases like reading student name and contact details and display in a required
2 format
2. Compare and contrast input () and raw_input() and identify its appropriate use.
Department of Collegiate and Technical Education, Government of Karnataka 7
3. Identify use of operators and develop algorithms to solve the same
4. Compare and contrast different types of operators
1. Identify use cases that involve decision making and develop algorithms to solve the same
3
1. Identify common syntactical errors when using control flow statements
1. Identify use cases that involve iteration and develop algorithms to solve the same
4 2. Compare and contrast different types of loops
2. Identify common syntactical errors when using loops
1. Identify use cases and solve them using sets
5 2. Identify use cases and solve them using tuples
3. Identify common syntactical errors when working with sets and tuples
1. Identify use cases and solve them using List
6 2. Identify common syntactical errors when working with List
3. Reimplement built in list functions
1. Identify use cases and solve them using dictionary
7 2. Reimplement built in dictionary functions
3. Identify common syntactical errors when working with dictionary
1. Identify use cases and solve them using arrays
8 2. Reimplement built in string functions
3. Identify common syntactical errors when working with arrays and strings
9 1. Optimize previously written programs by using modular programming approach
1. Identify and present pros and cons of modules and packages
10
1. Explore and present python built in modules.
1. Identify the applications of Pandas
11
2. Perform data analysis using Pandas module on a dataset such as .
1. Identify use cases on files concept and develop algorithms to solve the same
12
2. Explore regular expressions and present how they can be used for file manipulation
3. Compare and contrast error and exception.
13
4. Rewrite the programs using exceptions if needed
4. CIE and SEE Assessment Methodologies
Sl. Test Duration Max
Assessment Conversion
No Week In minutes marks
1. CIE-1 Written Test 5 80 30 Average of three
2. CIE-2 Written Test 9 80 30 tests
3 CIE-3 Written Test 13 80 30 30
4. CIE-4 Skill Test-Practice 6 180 100 Average of two skill
tests reduced to
5 CIE-5 Skill Test-Practice 12 180 100
20
CIE-6 Portfolio continuous
6 evaluation of Activity through 1-13 10 10
Rubrics
Total CIE Marks 60
Semester End Examination (Practice) 180 100 40
Total Marks 100
5. Format for CIE written Test
Course Name Python Programming Test I/II/III Sem III/IV
Course Code 20CY31P Duration 80 Min Marks 30
Note: Answer any one full question from each section. Each full question carries 10 marks.
Cognitive Course
Section Assessment Questions Marks
Levels Outcome
I 1
Department of Collegiate and Technical Education, Government of Karnataka 8
2
3
II
4
5
III
6
Note for the Course coordinator: Each question may have one, two or three subdivisions. Optional questions in each
section carry the same weightage of marks, Cognitive level and course outcomes.
6. Rubrics for Assessment of Activity (Qualitative Assessment)
Sl. Dimension Beginner Intermediate Good Advanced Expert Students
No. Score
2 4 6 8 10
1 Descriptor Descriptor Descriptor Descriptor Descriptor 8
2 Descriptor Descriptor Descriptor Descriptor Descriptor 6
3 Descriptor Descriptor Descriptor Descriptor Descriptor 2
4 Descriptor Descriptor Descriptor Descriptor Descriptor 2
Average Marks= (8+6+2+2)/4=4.5 5
Note: Dimension and Descriptor shall be defined by the respective course coordinator as per the activities
7. Reference:
Sl. No. Description
1 Core python programming, Wesley J. Chun Publisher: Prentice Hall PTR
2 Fluent Python by Luciano Ramalho
3 [Link]
4 [Link]
5 [Link]
6 [Link]
7 [Link]
8. CIE Skill Test and SEE Scheme of Evaluation
SL.
Particulars/Dimension Marks
No.
Develop an algorithmic solution for the given problem statement based on the
1 20
documentation of each of the steps involved, including input, output and logic.
2 Write program for the above given problem choosing relevant python constructs. 20
3 Code, execute, test and debug the above program. 30
Demonstrate how your program has solved the given problem
4 In the event of, a student fails to get the desired result (with no syntactical and least 20
semantic errors), the examiner shall use viva voce to assess the student’s problem-
solving and python programming skills
5 Portfolio evaluation based on aggregate of all practice sessions 10
Total Marks 100
9. Equipment/software list with Specification for a batch of 20 students
Department of Collegiate and Technical Education, Government of Karnataka 9
Sl.
Particulars Specification Quantity
No.
1 Python 3.8 20
Editor such as iPython, Jupyter, spider, PyCharm , google
2 20
CoLab
3 Computers 20
Department of Collegiate and Technical Education, Government of Karnataka 10