Python
Python
Total Hours: 60
Python Programming |Semester:
Common for CS,BCA,IT,CT,AlRDS)Credits: 40
Course Otbjective
The course aims
To learn core Python scripting elements such as variables and flow control structures.
To acquire programming and Object Oriented Skills in Python.
" To learm file handling concepts and exception handling in Python.
Course Outcomes (CO)
On the successful completion of the course, students will be able to
Knowledge CO
Course Outcome
Level Number
K1, K2, KS CO1 Explain the basic principles of Python programming language
K1, K2, KS CO2 Express different Decision Making statements, Arrays and Strings.
K1, K2, K3, CO3 Describe the Functions, List, Tuples and Dictionaries.
K1, K2, K3,
CO4 Implement the concept of Object Oriented Programming
K4, KS
K1, K2, K3, Understand and design Interfaces, Exceptions and different File handling
COS
K4, KS operations.
KI - Remember; K2-Understanding: K3- Apply; K4 Analyze; KS- Evaluate
SYLLABUS
No, of
Unit Content
Hours
Introduction to Python: Python, Features of Python, Execution of Python program,
Python Virtual Machine (PVM) Datatypes in Python: Comments, DocStrings, How
Python l n Datatypes, bool Datatype,
Sequences Sets
I Literals,sees Variables,h
Determining the dvarabie, Characters, User-defined Dataty 12
Datatypes,
Constants, ntifier and Reserved words, Naming Conventions. Operators, Input and
Output.
Control Statements: Control Statements, The if Statement, A Word on Indentation,
The if..else Statement, The if..elit..clse Statement, The while Loop. The for Loop,
|Infinite Loops, Nested Loops, The else Suite, The break Statement, The continue
Statement, The pass Statement, The assert Statement, The return Statement, Arrays in
Python: Array, Advantages of Arrays, Creating an Array, Importing the Array
Module, Indexing and Slicing on Arrays, Processing the Arrays, Types of Arrays, 12
String and Characters: Creating Strinos Lenoth1 Indexing, Repeatin
SSlicing.
caenation, Checking Membership, Comnarine Strings, Removing spaces rom a
Coneat
. Finding Sub Strings, Counting Substrings in a String, Strings are Immutable,
Replacing a String with another String, Splitting and Joining Strings, Changing Case
ofa String, Checking Starting and Ending of aString., String Testing Methods.
25
1. https:/lwww.tutorialspoint.com/python/index.htm
2. https://www.learnpython.org/
3. https://www.geeksforgeeks.orgpython-programming-examples/
Mapping with Programme Specific Outcomes
PSO
PSO1 PSO2 PSO3 PS04 PSOS
CO
CO1 S S S H
C02 S S H
Co3 S S H
C04 S S
COSs S S H
S- Strong; H- High, M- Medium: L- Low
S.NO:3o5 BATCH: 2019 REG. NO.
END OF SEMESTER EXAMINATIONS, DECEMBER- 2020
PYTHON PROGRAMMING
SUBJECT CODE: 19UACSO8
MAJOR: B.SC. (CS) SEMESTER :III
TIME :3 HOURS MAX. MARKS: 70
..2...
SECTION-B(6X5= 25)
Answer AIl questions:
16. a) Explain bricfly about various Features of Python.
(OR)
b) Analyse in detail various data types uscd in Python with example.
17. a) Develop aPython program that prints /2.'/3.'l ../1 using for loop.
(OR)
b) Analyze any 5 types of Methods of String Objects with example.
18. a) Describe in dctail Default Arguments in Functions with example.
(OR)
b) Outline with cxample about List Slicing and Nested Lists.
19. a) Analyze Single Inheritance with schematic representation.
(oR)
b) Describe Method Overriding in Python with example.
20. a) What is abstract class? Describe in detail about the importance of abstract class with
Cxample.
(OR)
b) Summarize about various mode of the Opening a File with example.
RezNo.
14. When Python Virtual Machine(PVM) cannot execute the byte code, it flags
a) Compile time error b) Logical error c) Runtime error d) Syntax error
15. Which block is useful to catch an exception?
a) Try b) except c) Catch d) Finally
SECTIONB(Sx5= 25)
Answer AllL the Questions
16. a) Explain the features of Python.
(OR)
b) List out datatypes in Python.
17. a) Demonstrate the various methods of Array class with suitable examples. Class with suitable examples.
(OR)
b) Discuss the different methods for finding substrings in python.
18.a) Explain the different types of actual arguments in Python functions.
(OR)
b) How to Create a List with ten elements and find the biggest and smallest elements among them.
19.a) Write a Python program to display students marksheet using class and objects.
(OR)
b) Describe the different types of methods used in class definition.
20.a) Compare Abstract classes vS Interfaces.
(OR)
b)Write a Python program to create your own exception and raise it when needed
SECTION C(3x10 = 30)
Answer Any THREE Questions
21. Illustrate the Input and Output statements in Python programming.
22. Briefly explain about the control statements in Python.
23. Write a Python program to create a dictionary with employee details & show the usage of for loop to retrieve the
elements of dictionary.
24. Explain polymorphism concept with suitable examples.
25. How would you open and close a file? Write a Python program to count number of lines, words and characters
in a text file.