CORE – XII PROGRAMMING IN PYTHON
SUBJECT CODE : THEORY MARKS : 100
SEMESTER : V CREDITS : 4 NO. OF HOURS : 90
Course Framework:
This course is a depth introduction to fundamental python programming concepts.
Course Outcome:
On completion of the course the students will be able
1. To learn how to install Python, Start the Python shell.
2. To learn how to perform basic calculations, performsimple control flow operations
using if statements and for loops.
3. To learn how to reuse code with functions.
4. To describe the semantics of python programming language and illustrate the process
ofstructuring the data using lists, dictionaries, tuples, strings and sets.
5. To understand the concepts of object-oriented programming in python.
UNIT I (18 hrs)
Introduction: Introduction to Python, Python Variables, Expressions, Statements:
Variables, Keywords, Operators & Operands, Expressions, Statements, Order of
Operations, String Operations, Comments, Keyboard Input. Functions: Type
Conversion function, Math functions, Composition of Functions, Defining own
function, Parameters, Arguments, Importing Functions.
UNIT II (20 hrs)
Conditions & Iterations: Conditions, Modulus Operator, Boolean Expression, Logical
Operators, if, if-else, if-elif-else, nested conditions. Iteration while, for, break,
continue, Nested loop.
UNIT III (18 hrs)
Recursion: Python recursion, Recursion error. Strings: Accessing values in String,
Updating String, Slicing String, String Methods – upper(), find(), lower(), capitalize(),
count(), join(), len(), isalnum(), isalpha(), isdigit(), islower(), isnumeric(), isspace(),
isupper() max(), min(), replace(), split().
UNIT IV (18 hrs)
Structures & Functions: List: Introduction, Traversal, Operations, Slice, Methods,
Delete element, Difference between Lists and Strings. Dictionaries: Introduction, Brief
idea of Dictionaries & Lists. Tuples: Introduction, Brief idea of Lists & Tuples, Brief
idea of Dictionaries & Tuples. Date & Time, Modules, Defining Functions, Exit
function, Default arguments.
UNIT V (16 hrs)
Classes & Objects: Creating class, Instance objects, Accessing attributes, Built in class
attributes, destroying objects, Inheritance, Method overriding, Overloading methods,
Overloading operators, Data hiding. Exceptions in Python, Detecting and Handling
Exceptions, Exceptions as Strings, Raising Exceptions, Assertions, Standard
Exceptions.
PRESCRIBED BOOKS
1. Allen Downey, Jeffrey Elkner, Chris Meyers, ―How to Think Like a
Computer Scientist - Learning with Python, Green Tea Press,2002.
REFERENCE BOOKS
1. John V. Guttag, ―Introduction to Computation and Programming using
2. Python‖, Prentice Hall of India, 2014.
3. Mark Lutz, ―Learning Python: Powerful Object-Oriented Programming‖, Fifth
Edition, O‘Reilly, Shroff Publishers and Distributors, 2013.
QUESTION PAPER PATTERN:
Section Question Component Numbers Marks Total
Definition/Principle
Answer any 10 out of 12
A 1-12 3 30
questions
(each in 50 words)
Short Answer
Answer any 5 out of 7
B 13-19 6 30
questions
(each in 300 words)
Essay
Answer any 4 out of 6
C 20-25 10 40
questions
(each in 600 words)
TOTAL MARKS 100
DISTRIBUTION OF QUESTIONS:
No. of Questions
Section Units
Theory Problems
Unit – 1 3
Unit – 2 3
A Unit – 3 2
Unit – 4 2
Unit – 5 2
Unit – 1 2
Unit – 2 1
B Unit – 3 2
Unit – 4 1
Unit – 5 1
Unit – 1 1
Unit – 2 2
C Unit – 3 1
Unit – 4 1
Unit – 5 1
CORE – XIII PRACTICAL – PYTHON LAB
SUBJECT CODE : PRACTICAL MARKS : 100
SEMESTER : V CREDITS : 4 NO. OF HOURS : 90
Course Framework:
To learn how to design and develop python applications.
Course Outcome:
On completion of the course the students will be able
1. To understand why python is a useful scripting language for developers.
2. To learn how to read and write files in Python.
3. To learn how to design and program python applications.
4. To design programs using python object types.
5. To demonstrate the basic database design for storing data as part of a multi-step data
gathering, analysis and processing.
Lab Exercises:
1. Compute the GCD of two numbers.
2. Find the square root of a number (Newton’s method).
3. Exponentiation (power of a number).
4. Find the maximum of a list of numbers.
5. Linear search and Binary search.
6. Selection sort, Insertion sort.
7. Merge sort.
8. First n prime numbers.
9. Multiply matrices.
10. Programs that take command line arguments (word count).
11. Find the most frequent words in a text read from a file.