Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Python Programming Complete Notes

Rating
-
Sold
-
Pages
88
Uploaded on
18-09-2025
Written in
2023/2024

This document is a comprehensive set of notes on Python programming prepared for undergraduate computer science students. It covers Python from the ground up, starting with fundamental concepts and progressing to advanced topics. The material begins with an introduction to Python basics, objects, and standard data types such as numbers, strings, lists, tuples, dictionaries, and sets. It explains operators, built-in functions, and object identity versus value comparisons. Subsequent units delve into more advanced topics including file handling, exception handling, and modules, equipping students with essential skills for building modular and error-tolerant programs. The notes also explore regular expressions and multithreaded programming, offering insights into text processing and concurrent execution. Learners are introduced to GUI programming with Tkinter and web programming with Python, including creating clients, CGI applications, and HTTP servers. The final sections cover database programming with Python’s DB-API and ORMs, helping students integrate Python applications with relational databases.

Show more Read less
Institution
Course

Content preview

PYTHON PROGRAMMING




II-I. semester CSE (DS)




PYTHONPROGRAMMING
COMPLETE NOTES




Prepared by:
Dr.M.Purushotham
Professor
Dept. of CSE (DS)
Sreyas Institute of Engineering and Technology
Nagole, Hyderabad.


2022-23

SREYAS INSTITUTE OF ENGINEERING AND TECHNOLOGY

, PYTHON PROGRAMMING

SYLLABUS


UNIT-I

Python Basics, Objects- Python Objects, Standard Types, Other Built-in Types,
InternalTypes,StandardTypeOperators,StandardTypeBuilt-
inFunctions,CategorizingtheStandardTypes,UnsupportedTypes.
Numbers - Introduction to Numbers, Integers, Floating Point Real Numbers,
ComplexNumbers,Operators,Built-inFunctions,RelatedModules
Sequences-Strings,Lists, andTuples,MappingandSetTypes

UNIT- II
FILES: File Objects, File Built-in Function [ open() ], File Built-in Methods, File Built-
inAttributes,StandardFiles,Command-
lineArguments,FileSystem,FileExecution,PersistentStorage Modules,RelatedModules.
Exceptions:ExceptionsinPython,DetectingandHandlingExceptions,ContextManagement,*
ExceptionsasStrings,RaisingExceptions,Assertions,StandardExceptions,*Creating
Exceptions,Why Exceptions (Now)?,Why Exceptions atAll?,Exceptionsandthe sys
Module,RelatedModules.
Modules:ModulesandFiles,Namespaces,ImportingModules,ImportingModuleAttributes,M
odule Built-inFunctions,Packages,OtherFeaturesofModules

UNIT-III
Regular Expressions: Introduction, Special Symbols and Characters, Res and
PythonMultithreadedProgramming:Introduction,ThreadsandProcesses,Python,Threads,and
theGlobalInterpreterLock,Thread Module,Threading Module,Related Modules

UNIT- IV
GUI Programming: Introduction, Tkinter and Python Programming, Brief Tour of
OtherGUIs,RelatedModules andOtherGUIs
WEBProgramming:Introduction,WedSurfingwithPython,CreatingSimpleWebClients,
Advanced Web Clients, CGI-Helping Servers Process Client Data, Building
CGIApplicationAdvancedCGI,Web(HTTP)Servers

UNIT–V
Database Programming: Introduction, Python Database
ApplicationProgrammer’sInterface(DB-
API),ObjectRelationalManagers(ORMs),RelatedModules

TEXTBOOK:
CorePythonProgramming,WesleyJ. Chun, SecondEdition, Pearson




SREYAS INSTITUTE OF ENGINEERING AND TECHNOLOGY

, 1


UNITI–INTRODUCTION TOPYTHON

1.1 PythonBasics
Python is a high-level, interpreted, interactive and object-oriented scripting language.
Python is designed to be highly readable. It uses English keywords frequently whereas the other
languages use punctuations. It has fewer syntactical constructions than other languages.
1. Pythonis Interpreted− Python is processed at runtime by the interpreter. You donot
need to compile your program before executing it. This is similar to PERL and PHP.
2. Python is Interactive − You can actually sit at a Python prompt and interact with the
interpreter directly to write your programs.
3. Python is Object-Oriented − Python supports Object-Oriented style or technique
ofprogrammingthatencapsulatescodewithinobjects.
4. Python is a Beginner's Language − Python is a great language for the beginner-
levelprogrammers and supports the development of a wide range of applications
fromsimple textprocessingtoWWW browsers togames.

History of Python:
Python was developed by Guidovan Rossumin the late eighties and early nineties at the
National Research Institute for Mathematics and Computer Science in the Netherlands.
Pythonisderivedfrommanyotherlanguages,includingABC,Modula-3,C,C++,Algol-
68,SmallTalk,andUnixshellandotherscriptinglanguages.
➢ Pythonis copyrighted. LikePerl,Pythonsourcecodeis
nowavailableundertheGNUGeneralPublicLicense(GPL).
➢ Pythonisnowmaintainedbyacoredevelopmentteamattheinstitute,althoughGuidovanRos
sumstillholds a vitalroleindirectingitsprogress.
➢ Python1.0wasreleasedinNovember1994.In2000,Python2.0wasreleased.Python
2.7.11isthelatesteditionofPython2.
➢ Meanwhile, Python 3.0 was released in 2008. Python 3 is not backward compatiblewith
Python 2. The emphasis in Python 3 hadbeen on the removal of duplicateprogramming
constructs and modules so that "There should be one -- and preferablyonlyone--
obviouswaytodoit."Python3.5.1isthelatestversionofPython3.

PythonFeatures:
1. Easy-to-
learn−Pythonhasfewkeywords,simplestructure,andaclearlydefinedsyntax.Thisallowsa
studenttopickupthe language quickly.
2. Easy-to-read−Pythoncodeis moreclearlydefinedandvisibletotheeyes.
3. Easy-to-maintain−Python'ssourcecodeis fairlyeasy-to-maintain.
4. Abroadstandardlibrary−Python'sbulkofthelibraryisveryportableandcross-
platformcompatibleonUNIX,Windows,andMacintosh.
5. InteractiveMode−Pythonhassupportforaninteractivemodewhichallowsinteractive
testinganddebuggingofsnippets ofcode.




M. Naresh Choudary | SREYAS INSTITUTE OF ENGINEERING AND TECHNOLOGY

, 2


6. Portable−Pythoncanrunonawidevariety ofhardwareplatformsandhasthesameinterface
onallplatforms.
7. Extendable−Youcanaddlow-
levelmodulestothePythoninterpreter.Thesemodulesenableprogrammersto
addtoorcustomizetheirtoolsto bemoreefficient.
8. Databases−Pythonprovides interfacestoallmajorcommercialdatabases.
9. GUI Programming − Python supports GUI applications thatcan be created andported
to many system calls, libraries and windows systems, such as Windows
MFC,Macintosh,andtheX WindowsystemofUnix.
10. Scalable − Python provides a better structure and supportfor large programs
thanshellscripting.

1.2 PythonObjects
Python uses the object model abstraction for data storage. Any construct that
containsanytypeofvalueisanobject.AlthoughPythonisclassifiedasan"object-
orientedprogramming (OOP) language," OOP is not required to create perfectly working
Pythonapplications. You can certainly write a useful Python script without the use of classes
andinstances. However, Python's object syntax and architecture encourage or "provoke" this
typeofbehavior.Letusnowtakea closerlookatwhata Pythonobjectis.

All Python objects have the following three characteristics: an identity, a type, and a
value.IDENTITY--
Uniqueidentifierthatdifferentiatesanobjectfromallothers.Anyobject'sidentifiercanbeobtainedus
ingtheid()built-
infunction(BIF).Thisvalueisascloseasyouwillgettoa"memoryaddress"inPython(probablymucht
othereliefofsomeofyou).Evenbetteristhatyou rarely,ifever,accessthisvalue,much
lesscarewhatitisatall.
TYPE--An object's typeindicates whatkind of values an objectcan hold,whatoperationscan be
applied to such objects, and what behavioral rules these objects are subject to. You canuse the
type() BIF to reveal the type of a Python object. Since types are also objects in Python(did we
mention that Python was object-oriented?), type() actually returns an object to
youratherthanasimpleliteral.
VALUE--Dataitemthatisrepresentedbyanobject.

All three are assigned on object creation and are read-only with one exception, thevalue.
(For new-style types and classes, it may possible to change the type of an object, butthis is not
recommended for the beginner.) If an object supports updates, its value can
bechanged;otherwise,itis alsoread-only.
Whether an object's value can be changed is known as an object's mutability.
Thesecharacteristicsexistaslongastheobjectdoesandarereclaimedwhenanobjectisdeallocated.

Python supports a set of basic (built-in)data types,as well as some auxiliary
typesthatmay comeintoplay if your application requires them. Mostapplications generally
usethestandardtypesandcreateandinstantiate classesforallspecializeddatastorage.

M. Naresh Choudary | SREYAS INSTITUTE OF ENGINEERING AND TECHNOLOGY

Written for

Institution
Course

Document information

Uploaded on
September 18, 2025
Number of pages
88
Written in
2023/2024
Type
Class notes
Professor(s)
Mahantesh
Contains
All classes

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
mokshithakatiki

Get to know the seller

Seller avatar
mokshithakatiki Sreyas Institute of Engineering and technology
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
8 months
Number of followers
0
Documents
11
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions