Python Ap

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

ACADEMIC PLANNER

For

“ PYTHON PROGRAMMING”

Presented by

A ANUSHA
Department of

CSE-Cyber Security

CMR ENGINEERING COLLEGE


(Approved by AICTE-New Delhi, Affiliated to J.N.T.U, Hyderabad)

Kandlakoya(v),Medchal Road,Hyderabad-501 401,Telangana State, India .Website: www.cmrec.ac.in

(2022-23)
ACADEMIC PLANNER
PYTHON PROGRAMMING

S.No Content Page No

1 Preamble/Introduction 2
2 Prerequisites 2
3 Objectives and Outcomes 2
4 Syllabus 5
1.CMREC(8R)-B.TECH-CSE-CYBER SECURITY-R20(Autonomous)
SYLLABUS
2.GATE
5 List of Expert Details (Local/National/International with Contact 7
details/Profile link/Blogs/their research Contribution towards the
subject)
6 Journals with min 5 ref paper 7
7 Subject -Lesson plan 10
8 Suggested Books (prescribed and References) 11
9 Websites for self learning Resources like 12
www.geeksforgeeks.org,www.schools.com, Coursera ,edX, Udemy,
Khan Academy, NPTEL etc along Registration procedures
10 Question Banks 15
1.JNTUH-Model papers
2.GATE
11 Two case study presentations with Project / Product/ Model 17
/Prototypes/ Industrial applications.
12 Assignment Question/Innovative Assignments sets. 18
13 List of topics for students Seminars with Guidelines 19
14 STEP/Course material in softcopy 19
15 Expert Lectures with topics & Schedules(if any) 19
(1) COURSE INTRODUCTION TO PYTHON PROGRAMMING

Python is a popular programming language. It was created by Guido van Rossum and
released in 1991. Python works on different platforms (Windows, Mac, Linux, Raspberry
Pi, etc).It has a simple syntax similar to the English language. Python can be treated in a
procedural way, an object-oriented way or a functional way.It has syntax that allows
developers to write programs with fewer lines than some other programming languages.

(2) OBJECTIVES, RELEVANCE AND OUTCOMES


 Learn Syntax and Semantics and create Functions in Python.
 Handle Strings and Files in Python.
 Understand Lists, Dictionaries and Regular expressions in Python.
 Implement Object Oriented Programming concepts in Python.
 Build Web Services and introduction to Network and Database Programming
in Python.

Course Outcomes:
 Examine Python syntax and semantics and be fluent in the use of
Python flow control and functions.
 Demonstrate proficiency in handling Strings and File Systems.
 Create, run and manipulate Python Programs using core data structures
like Lists, Dictionariesand use Regular Expressions.
 Interpret the concepts of Object-Oriented Programming as used in Python.
 Implement exemplary applications related to Network Programming, Web
Services andDatabases in Python

(3) PREREQUISITES:

Prerequisites: A course on “Programming for Problem Solving using C”.

(4.1)SYLLABUS -CMREC(8R)-B.TECH-CSE-CYBER SECURITY-R20(Autonomous)

UNIT – I
Python Basics, Objects- Python Objects, Standard Types, Other Built-in Types,
Internal Types, Standard Type Operators, Standard Type Built-in Functions,
Categorizing the Standard Types, Unsupported Types
Numbers - Introduction to Numbers, Integers, Floating Point Real Numbers,
Complex Numbers, Operators, Built-in Functions, Related Modules
Sequences - Strings, Lists, and Tuples, Mapping and Set Types

UNIT - II
FILES: File Objects, File Built-in Function [ open() ], File Built-in Methods, File
Built-in Attributes, Standard Files, Command-line Arguments, File System, File
Execution, Persistent Storage Modules, Related Modules
Exceptions: Exceptions in Python, Detecting and Handling Exceptions, Context
Management,
*Exceptions as Strings, Raising Exceptions, Assertions, Standard Exceptions,
*Creating Exceptions, Why Exceptions (Now)?, Why Exceptions at All?,
Exceptions and the sys Module, Related Modules Modules: Modules and Files,
Namespaces, Importing Modules, Importing Module Attributes, Module Built-in
Functions, Packages, Other Features of Modules

UNIT III
Regular Expressions: Introduction, Special Symbols and Characters, Res and Python
Multithreaded Programming: Introduction, Threads and Processes, Python,
Threads, and the Global Interpreter Lock, Thread Module, Threading Module,
Related Modules.

UNIT IV

GUI Programming: Introduction, Tkinter and Python Programming, Brief Tour of


Other GUIs, Related Modules and Other GUIs
WEB Programming: Introduction, Wed Surfing with Python, Creating Simple Web
Clients, Advanced Web Clients, CGI-Helping Servers Process Client Data,
Building CGI Application
Advanced CGI, Web (HTTP) Servers.

UNIT V

Database Programming: Introduction, Python Database Application Programmer’s


Interface (DB-API), Object Relational Managers (ORMs), Related Modules.

(4.2) SYLLABUS - GATE

Not applicable

(4.3) SYLLABUS - IES


Not applicable

.(5)EXPERT DETAILS
. EXPERT DETAILS

The Expert Details which have been mentioned below are only a few of the eminent
ones known Internationally, Nationally and Locally. There are a few others known
as well.

INTERNATIONAL
1. Ramez Elmasri,
Depart ment of Computer Science & Engineering,
College of Engineering,
The Universit y of Texas at Arlington, Arlington, USA.
2. C. Mohan,
IBM Fellow,
Almaden Research Center, San Jose, CA 95120, USA

3. Shankant B. Navathe,
College of Comput ing
Georgia Inst itute of Technology
801 At lant ic Dr., NW
At lanta, GA 30332-0280

NATIONAL

1. S. Sudarshan,
Dept. of CSE,
IIT, Bombay.

2. P. Sreenivasa Kumar
Dept of CSE,
IIT, Madras

REGIONAL
1. Kamalakar Karlapalem
Data Sciences and Analyt ics,
IIIT, Hyderabad.
2. Manish Singh
IIT, Hyderabad

(6) JOURNALS
INTERNATIONAL
1. https://www.researchgate.net/publication/269179027_The_Python_Project_A_Unique
_Model_for_Extending_Research_Opportunities_to_Undergraduate_Students
2. https://ieeexplore.ieee.org/abstract/document/9610674

3. https://iopscience.iop.org/article/10.1088/1742-6596/423/1/012027

NATIONAL
1. https://ijirt.org/ma ster/publishedpaper/IJIRT149340_PAPER.pdf
2. https://www.ijsr.net/archive/v8i2/ART20194929.pdf
(7)SUBJECT (LESSON) PLAN )
NO. OF
Suggest Teaching
S.NO Topic Sub-Topic LECTURES
ed Methods
REQUIRED
Books
UNIT – I

1 Python Objects, Standard Types L1,L2 T1, M1


R1
Other Built-in Types, Internal
2 L3-L4 T1 M1
Types
Python Basics,
Objects, Numbers,
Sequences Standard Type Operators,
3 Standard Type Built-in L5,L6 T1 M1
Functions

Categorizing the Standard

4 Types, Unsupported Types L7-L8 T1, M1


R1

Introduction to Numbers, T1
5 L9,L10 M1
Integers, Floating
Point Real
Numbers
Complex Numbers, Operators, T1

6 L11,L12 M1

Built-in Functions, Related T1


7 Modules
L13,14 M1

Strings, Lists, and Tuples,


L15-L16 T1,
8
R1 M1
Mapping and Set Types

L17 T1,
9
R2 M1

UNIT- II

FILES, Exceptions, File Objects, File Built-in Function


[ open() ]
Modules
10 T1,
L18-L19 R2 M4

File Built-in Methods, File Built-in


Attributes T1,
L20,L21 R2
11
M1

Standard Files, Command-


13 L22,L23 T1, M1
line Arguments,
R3
File System, File Execution,

14 L24,25 T1 M4

Persistent Storage
15 Modules, Related Modules L26,L27 T1 M5

Exceptions in
16 L28,L29 T1 M1
Python,Detectin
g and Handling
Exceptions
Context Management, L30,L3
17 T1,R3 M5
*Exceptions as Strings, Raising 1
Exceptions,
Assertions, Standard Exceptions, L32,L3
18 *Creating Exceptions, Why T1,R3 M4
3
Exceptions (Now)?,
Why Exceptions at All?,Exceptions
and the sys Module, L34,L3
19
Related Modules 5
T1,R3 M5
20 Modules and Files, Namespaces L36,37 T1 M5

Importing Modules,
21 L38,L3 T1,R2 M4
Importing Module 9
Attributes
Module Built-in Functions,
22 L40,L4 T1 M4
Packages 1

Other Features of Modules


23 L42 T1 M5

UNIT -III
Introduction, Special
24 L43 T1 M4
Symbols and Characters,
Res and Python
Regular Expressions,
Multithreaded Introduction, Threads and
L44
Programming, Processes, Python T1 M4

Thread Module, Threading Module,


25 Related Modules M5
L45- T1
L46

UNIT-IV

26 Introduction, Tkinter and Python


L47 T1 M5
Programming

Brief Tour of Other GUIs,


27 Related Modules and Other L48,L4 T1,R2 M4
GUIs 9

GUI Programming, Introduction, Wed Surfing with


28 L50,L5 T1 M4
WEB Programming
Python, Creating Simple 1
Web Clients,
Advanced Web Clients, CGI-
29 Helping Servers L52- T1 M4
Process Client Data, L53 &M5
26 Building CGI Application
Advanced CGI, Web (HTTP) L54 T1 M5
Servers

UNIT-V

Introduction, Python Database


27 L55 T1,R2 M4
Application
Programmer’s
Interface (DB-API),
Database Object Relational Managers M4
(ORMs), Related Modules. L56 T1,R2
Programming

METHODS OF TEACHING:

M1 : Lecture Method M6 : Tutorial

M2 : Demo Method M7 : Assignment

M3 : Guest Lecture M8 : Industry Visit

M4 : Presentation /PPT M9 : Project Based

M5 : Lab/Practical /Activity M10 : Charts / OHP

8) SUGGESTED BOOKS

TEXT BOOKS
1. Core Python Programming, Wesley J. Chun, Second Edition, Pearson.

REFERENCE BOOKS

1. Think Python, Allen Downey, Green Tea Press


2. Introduction to Python, Kenneth A. Lambert, Cengage
3. Python Programming: A Modern Approach, Vamsi Kurama, Pearson
4. Learning Python, Mark Lutz, O’Really

(9) WEBSITES
1) https://www.digimat.in/nptel/courses/video/106106182/L01.html
2)https://www.youtube.com/watch?v=c235EsGFcZs
3) https://www.w3schools.com/python/
4) https://www.javatpoint.com/python-basic-programs
5) https://www.guru99.com/python-tutorials.html
6) https://www.tutorialspoint.com/python/index.html

(10) QUESTION BANK

Code No: R1621054 R16 SET - 1

II B. Tech I Semester Supplementary Examinations, May - 2019


PYTHON PROGRAMMING
(Com to CSE & IT)

Time: 3 hours Max. Marks: 70


Note: 1. Question Paper consists of two parts (Part-A and Part-B)

2. Answer ALL the question in Part-A


3. Answer any FOUR Questions from Part-B
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PART –A
1. a) What is the difference between compiled and interpreted languages? (2M)
b) How pass statement is different from a comment? (2M)
c) What are mutable and immutable types? (3M)
d) What is the purpose of global keyword in Python? (2M)
e) How to handle multiple exceptions with single except clause? (3M)
f) Write Python script that prints calendar of November 2017. (2M)
PART -B

2. a) Differentiate between C++ and Python. (7M)


b) Give a not on each of the below Python language constructs: (7M)
(i) quotes (single, double and triple) (ii) multiline statements (iii)
indentation

3. a) List different operators in Python, in the order of their precedence. (9M)


b) Write a Python program to compute distance between two points in a 2- (5M)
dimensional coordinate system.

4. a) Explain with an example, how + and * operators work with strings. (6M)
b) Write a Python program that prints the intersection of two lists. (without (8M)
usinglist comprehension/sets)

5. a) What is lambda function? What are the characteristics of a lambda function? (7M)
Give an example.
b) Write a recursive Python function that recursively computes sum of (7M)
elementsin a list of lists.
Sample Input: [1, 2, [3,4], [5,6]] Expected Result: 21
6. a) What are different types of inheritance supported by Python? Explain. (8M)
b) What s the difference between else block and finally block in exception (6M)
handling? Explain with an example program.

7. a) Explain about Radiobutton widget in tkinter. How to create two radiobuttonsets (one for
gender and another for Indian or not) on the same canvas.
b) Write a Python program that creates two a demon threads and two non-daemonthreads.
Main thread should wait for all other threads to finish.

Code No: R1621054 R16 SET - 1

II B. Tech I Semester Supplementary Examinations, October/November - 2020PYTHON


PROGRAMMING
(Com to CSE & IT)

Time: 3 hours Max. Marks: 70


Note: 1. Question Paper consists of two parts (Part-A and Part-B)

2. Answer ALL the question in Part-A


3. Answer any FOUR Questions from Part-B
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PART –A

1. a) What Python uses, static typing or dynamic typing? Justify your answer with
(2M)
an example.
b) Write a for loop that prints numbers from 0 to 57, using range function. (2M)
c) Write a Python statement that swaps values of two variables. (only one (2M)
linestatement)
d) What is PIP. (2M)
e) How to create a destructor in Python? Give an example. (3M)
f) Write python script to print current date and time. (3M)
PART -B

2. a) Explain the history of Python evolution. (7M)


b) Write a Python program that reads four integers from user, prints them with (7M)
asingle print statement, without any space or newline between/after the
values.

3. a) What is the purpose of else clause for a loop? Explain how else works with (8M)
while and for loops, with examples.
b) Write a Python program that prints multiplication table of a given number. (6M)

4. a) What is a list in Python? How to create nested lists? Demonstrate how to (7M)
createand print a 3-dimensional matrix with lists.
b) Write a Python program that counts the number of occurrences of a letter in (7M)
astring, using dictionaries.

5. a) Python.
Explain about different types of arguments in
(8M)
b) Write a Python function that computes the harmonic sum of (6M)
n.Harmonic Sum = (1/2) + (1/4) + (1/8) + (1/16) + ….. + (1/2n)

6. a) Demonstrate implementation of hierarchical inheritance in Python, with a (7M)


program.
b) What happens if except clause is written without any Exception type? Explain (7M)
with an example.

7. a) Explain how to write test cases in Python. (7M)


b) Write a Python turtle program to draw a blue square of size 200 and the draw agreen circle
which touches the square on all sides from inside.

Code No: R1621054 R16 SET - 1

II B. Tech I Semester Supplementary Examinations, May - 2018PYTHON


PROGRAMMING
(Com to CSE & IT)

Time: 3 hours Max. Marks: 70


Note: 1. Question Paper consists of two parts (Part-A and Part-B)

2. Answer ALL the question in Part-A


3. Answer any FOUR Questions from Part-B
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PART –A

1. a) What happens if a semicolon (;) is placed at the end of a Python statement? (2M)
b) What are membership operators? Give examples for usage. (3M)
c) What is a dictionary in Python? (2M)
d) Can a Python function return multiple values? If yes, how it works? (2M)
e) How to make a Python class member variable hidden from outside the class? (2M)
f) Write Python program to calculate your age in days. (days between (3M)
Today and Date of Birth)
PART -B
2. a) What are different applications of Python? Give examples. (6M)
b) Write a Python program to convert height in feet and inches (8M)
to cm. [1 feet = 12 inch and 1 inch= 2.54 cm]
(Sample input: 2 feet 7 inch Sample output: 78.74 cm)

3. a) List and explain different arithmetic operators supported by Python. (7M)


Discuss about their precedence and associativity.
b) Write a Python program to print all prime numbers less than 256. (7M)

4. a) Write a Python program that interchanges the first and last characters of (6M)
a given string.
b) Give a comparison between lists, tuples, dictionaries and sets. (8M)
5. a) What type of parameter passing is used in Python? Justify your (7M)
answer withsample programs.
b) Write a Python function that prints all factors of a given number. (7M)

6. a) Write a Python program that overloads + operator, to add two (7M)


objects of a class.
b) How to create, raise and handle user defined exceptions in Python. (7M)
7. a) What are regular expressions? How to find whether an email id entered by user is valid or not
using Python‘re’ module. (4M)
b) Write a Python program that creates a GUI with a textbox, Ok button and Quit button. On
clicking Ok, the text entered in textbox is to be printed in Pythonshell; on clicking Quit, the
program should terminate. (3M)

ALL UNITS
Unit-I

 Explain about the need for learning python programming and its importance.
 Write in brief about the applications of Python.
 Explain the basics for executing a python program using REPL(Shell) with an example.
 Write a python program to read input using REPL(Shell) and display the output.
 Write the rules for choosing names of variables.
 Write in brief about any 5 keywords in Python.

Unit-II

 Explain about different Logical operators in python with appropriate examples.


 Explain about different Relational operators in python with appropriate examples.
 Explain about Membership operators in python with appropriate examples.
 Explain about Identity operators in python with appropriate examples.
 Explain about Arithmetic operators in python with appropriate examples.
 List different conditional statements in python with appropriate examples.
 What are the different Loops available in python?
 What are the different loop control statements available in python? Explain withsuitable examples.

Unit-III

 Explain about methods in Lists of Python with appropriate examples.


 Write a python program to describe different ways of deleting an element from thegiven List.
 What are the different operations that can be performed on a list? Explain with examples.

 Write in brief about List in python.


 Write in brief about Tuple in python. Write operations with suitable examples.
 Write in brief about Set in python.Write operations with suitable examples.
 Write in brief about Dictionary in python.Write operations with suitable examples.
 Write in brief about Sequence in python.Write operations with suitable examples.
 Compare List and Tuple.

Unit-IV

 Explain about fruitful functions with suitable examples.


 Explain about void functions with suitable examples.
 Compare fruitful and void functions.
 How to create a module and use it in a python program explain with an example.
 Explain the concept of namespaces with an example.
 Write about the concept of scope of a variable in a function.
 Write about different types of arguments in a function.
 Write in brief about anonymous functions.

Unit-V

 List the features and explain about different Object Oriented features supported byPython.
 Explain the concept of method overriding with an example.
 How to declare a constructor method in python? Explain.
 Explain the feature of Inheritance in python with an example.
 Differentiate between an error and exception.
 How to create a user defined exception?

( 11) Two Case Studies


1. Python – Spell Corrector GUI using Tkinter
Python offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI
methods, Tkinter is the most commonly used method. Python with Tkinter outputs the fastest and
easiest way to create GUI applications. In this article, we will learn how to create a GUI Spell
Corrector application using Tkinter, with a step-by-step guide.

To create a Tkinter :
 Importing the module – tkinter
 Create the main window (container)
 Add any number of widgets to the main window.
 Apply the event Trigger on the widgets.

2. Python: Age Calculator using Tkinter:


Python offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI
methods, Tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI
toolkit shipped with Python. Python with Tkinter outputs the fastest and easiest way to create GUI
applications. Now, it’s up to the imagination or necessity of a developer, what he/she wants to
develop using this toolkit.
To create a Tkinter :
 Importing the module – Tkinter
 Create the main window (container)
 Add any number of widgets to the main window.
 Apply the event Trigger on the widgets.

(12)Assignment Questions
UNIT-I

1.Define the definition of python programming and explain history of python.


2.How to install python in windows and linux OS.
3.How to work with variables and operators in python.
4.How to read the input from keyboard and explain with a program
5.Explain how decision structures will work in python with example.

UNIT-II
1. Discuss about how to formatting the text output.
2. What are functions to use file input and file ouput.
3. Discuss briefly about defining and calling a void function.
4. Write a program to create, append, and remove lists inpython.
5. Write a program to demonstrate working with tuples inpython.

UNIT-III
1. Summarize the Accessing Characters and Substrings in a String
2. Classify how Testing, Searching, and Manipulating Strings
3. Identify how Finding Items in Lists with the in Operator
4. Discuss short notes on Two-Dimensional Lists
5. Summarize the Problem Solving with Recursion

UNIT-IV
1. Discuss short notes on Classes and Objects
2. Discuss short notes on Classes and Functions
3. Discuss short notes on Classes and Methods
4. Discuss short notes on Working with Instances
5. Discuss short notes on Inheritance and Polymorphism
UNIT-V
1. Summarize the Behavior of terminal based programs and GUI-based programs
2. Write a program by using the tkinter Module
3. Discuss short notes that how Display text with Label Widgets
4. Write a program by using Labels as Output Fields
5. Name the function of Colors and RBG System in python.

INNOVATIVE ASSIGNMENT QUESTIONS

1. What are virtual environments, and how can you create a virtual environment by using the standard

Python library?

2. How do you debug a Python program?

3. Describe generators in Python and give a brief example of how to use them

(13) TOPICS FOR STUDENT’S SEMINARS


1. Mapping and set types

2. Other features of modules

3. Related modules

4. Web server

5. Object relational managers

(14)STEP/COURSE MATERIAL IN SOFTCOPY

ezyzip.zip

PYTHON PROGRAMMING STEP MATERIAL 2022-23(CYBER SECUIRTY )

(15) EXPERT LECTURE TOPICS


1. Strings
2.File Build in Methods
3,Thread Module
4.Wed Surfing with Python

***THE END***
CMREC CSE-CSC

10

You might also like