Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

Python

The document outlines a Python Programming course for B.Sc. Computer Science students, detailing course objectives, outcomes, and a comprehensive syllabus covering topics such as data types, control statements, functions, object-oriented programming, and file handling. It includes assessment formats with multiple-choice questions, descriptive questions, and programming tasks. Additionally, it lists textbooks and references for further study.

Uploaded by

sasidharana10sbc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Python

The document outlines a Python Programming course for B.Sc. Computer Science students, detailing course objectives, outcomes, and a comprehensive syllabus covering topics such as data types, control statements, functions, object-oriented programming, and file handling. It includes assessment formats with multiple-choice questions, descriptive questions, and programming tasks. Additionally, it lists textbooks and references for further study.

Uploaded by

sasidharana10sbc
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

24

Programme Code: B.Sc. Progranmme Title: Computer Science


Course Code: 23UACs06 Course Title: Batch: 2023

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

Functions: Difference between a Function and a Method, Defining a Function,


Calling a Function, Returning Results from a Function, Returning Multiple Values
|from a Function, Functions are First Class Objects, Pass by Object Reference, Formal
II and Actual Arguments, Positional Arguments, Keyword Arguments, Default 12
Arguments, Variable Length Arguments, Local and Global Variables, The Global
Keyword, Passing a Group of Elements to a Function, Recursive Functions. Lists and
Tuples, Dictionaries.
Introduction to OOPs: Classes and objects- Creating a Class, The self Variable,
IV constructor, Types of Variables, Namespace, Types of Methods, Passing Members of 12
One Class to Another Class, Inner Class. Inheritance and Polymorphism.
Abstract classes and Interfaces: Method and class, Interfaces in Python, Abstract
classes Vs Interfaces, Exceptions- Errors in a python programs, Exceptions,
Exception Handling, Types of Exceptions, " Files in python- Files, Types of Filein 12
Python, Opening a File, Closinga File, Working with Text Files Containing Strings,
Knowing Whether a File Exists or Not Working with Binary Files, The With|
Statemen, The seek)and tell) Methods, Random Accessing of BinaryFiles.
-SelfStudy>
Text Book:
Dr. R. Nageswara Rao, "Core Python Programming" Second Edition, Dreamtech Press, 2018.
(Unit-I to V)
Reference Books:
1. B.Nagesh Rao, "Lecarning Python", CyberPlus Infotech Pvt. Ltd., 2016-17.
2. Mike "Python -i-in easy steps", McGraw Hill Education (India) Private Limited, 2013.
3. Ashok Namdev Kamthane, Amit Ashok Kamthane, "Programming and Problem Solving with
PYTHON", McGraw Hill Education (India) Private Limited, 2018.
4. Reema Thareja, "Problem Solving and Programming with Python", Oxford University Press, 2018.
B-references:

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

SECTION- A(15X1 =15)


Answer All the questions:
Choose the correct answer:
1. Who is the developcr of thec Python?
a) Guido van Rossum b) James Gosling c) Steve Jobs d) Bill Gates
2. Single -linc Comment in Python contains:
a) ? b) c) % d)
3. The data type of fabs() arguments is
a) int b) float c) complex d) long int
4. Pass Statement
a) Continues the current iteration b) Skips the current iteration
c) performs nothing d) breaks the loop
5. Which decision statement is uscd for one condition
a) nested if b) if-clse c) if--clif-clse d) if
6. In case of looping, when is infinite cxecution allowed?
a) Conditions is sometimes True b) Conditions is sometime False
c) Condition is always True d) Condition is always False
7. List is
a) an unordered set of data items b) a string data type
c) an ordered set of data items d) a primitive data type
8. Which function is used to convert tuple to string?
a) cmp) b) convert) c) to) d) join)
9. A function that calls itsclf is called as
a) nested functions b) local functions
c) recursive functions d) global functions
10. Class variables are
a) void b) non-void c) static d) non-static
11. The functions defined within a class are called as
a) members b) methods c) submembers d) submethods
12. Self variable can access.
a) members b) methods c) both members and methods d) Class
13. which does not allow the creation of objects.
a) Constructor b) Meta Class c) Inner class d) Abstract class
14. Which block will be exccuted at any conditions?
a) clse b) finally c) except d) try
1s. A File can be created with
a) Input Strcam b) Output Stream c) File Stream d) Control Stream

..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.

SECTION- C(3X10 =30)


Answer any Thrce questions:
21. Describe briefly about the operators in Python with example.
22. Examine Syntax with cxample different types of Loop Statements in Pyhon.
23. Enumerate in detail about various Tuples Methods with example.
24. Summarize the concept of Classes and Objects in Python with example.
25. Elucidate briefly about various types of Exception with example.
13.Summarize the Random Access file related Verbs.
14 Briely expl sO Vgrh ith example.
I5. Write a progrm cpahe payslip preparation.

S. No. 3o+ BATCH: 20l7 2018 Reg. No.:


END OF SEMESTER EXIVIINATIOYS, DECE\IBER -2020
PITHON PROGRAIMING
SBJECT CODE: 1TACSOs
MAJOR: B.Sc. (CS) SEMESTER :I|
TIME :3 HOURS MAL. MIARKS; "s

SECTION -A (5N2= 10)


Answ er ALL thc questions:
1. What are comment and continuation statements'Give example.
2. What is the need for pass statement in Python'Give exan1pie
3. How to create and assign list values' Give erample.
4. List out the access modes for file obiects.
5. What is Search Path and Path Search?
SECTION-B (5X4= 20 )
Answer ALL the questions:
6. a) How do you do multiple assignments in python" Write swapping program using the
concepts.
(OR)
b) What are the three characteristics of Python Objcct' Explain.
7. a) What is use of break and continue? Give example codes.
(OR)
b) What is the use of while statement? Explain with its syntax and example
8. a) How to update and remove characters in string? Explain with examples.
(OR)
b) How do you update and remove values in tuples? Give examples.
9. a) What are standard files? Explain.
(OR)
b) Write any two persistence storage modules in Python.
10. a) What are formal and default argument of functions?
(OR)
b) Write short notes on Packages.

SECTION-C (3X15 = 45)


Answer any THREE questions:
I1. Explain
i) The module structure and layout of a Python program with diagrum. (lO Marks )
ii) The object identity comparison operators with example. (5 Mlarks)
12. Write a detailed note on for Statement with relevant examples.
13. Explain in detail
i) How to create and handle strings. (5 Marks)
ii) The List Type Built-in Methods with relevant syntax and examples. (10 Marks)
14. Describe the following
i) Command-line Arguments (5 Marks)
ii) Exceptions in Python. (any five) (10 Marks)
15. Elaborate the concepts of
i) Functions. (9 Marks)
ii) Module Built-in Functions. (6 Marks)

RezNo.

SN.388 IBATCIH: 20)7, 2e12


DEtBLR-2020
END OsEMISIERXAMINAIOS.
VISiAL. PROGHAMMIN,
SEMESTER /
MAJOR : B.SC, ((S,L,C/1A
TIME 3 I1OURS
17UncsIo)17UnITI4 MAXMA KS2

SECTION- A(5X2 - 10)


Aswer ALJ. the(estions:
I. Compare IXI: with DLJ. files
2. Ilighlight the concept of dialoy box.
3. Deign the lormat ol if t:ilement.
4 ComprcCHd thc tcn function.
5. llow would you classily error in Visual Basic?
SCTION - B(5X4= 20)
Answer ALJ. tlhe Qucstions:
Reg. No.
8: S.NO.301 BATCH:2019,2020 1%
END OF SEMESTER EXAMINATIONS, NOVEMBER- 2021
PYTHON PROGRAMMING
SUBJECT CODE: 19UACs08

MAJOR: B.Sc. (Computer Science) SEMESTER III


TIME: 3 HOURS MAX.MARKS: 70

SECTION-A (15 xl =15)


Answer AlLL the Questions:
Choosethe Correct Answer:
1. Python compiler translates the Python program into an intermediate code called
a) Source Code b) Byte Code c) Machine Code d) Reusable Code
2. Which of the following operator has highest precedence?
a) >= b) and c)" d) **
3. Which is the Bitwise Right Shift operator?
a) ++ b) - c)>> d) <<
4. ---Statement is useful to check if a particular condition is fulfilled or not.
a) Assert b) Break c) Return d) Else
5. Which statement is correct?
a) Arrays are similar to Sets b) Arrays can grow or shrink dynamically
c) Arays cannot grow or shrink dynamically d) Size of the array is fixed in Python
6 Name the method which converts the Capital letters into small letters and vice versa
a) upper (0 b) lower) c) swapcase() d) title)
7 -keywordis used to define a function
a) def b) lambda c) function d)map
8. -function is used to check whether the typed elements are a list or tuple
a) list() b) tuple() c) eval() d) All the above
9. Dictionary uses --symbol
a) () b) {} ))
10. If we write class B inside class A, then B is called as
a) Inner Class b) Nested Class c) Both (a) and (b) d) None of the Above
11. Which method is called 'Method Overriding' in inheritance?
a) Superclass method b) Subclass method c) Innerclass method d) Derivedclass method
12. An advantage of Inheritance
a) Increased productivity b) Longer time ) Code Complexity d) Response time
13. Identify the incorrect statement
a) A method with body is called Plain method b) Amethod with body is called Concrete method
) It is not possible to create an object to an abstract class d) We can create objects to subclasses
.2..

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.

You might also like