100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Class notes

Class notes R17A0554 (R17A0554) Beginning Python, ISBN: 9781430206347

Rating
-
Sold
-
Pages
159
Uploaded on
02-05-2023
Written in
2021/2022

These are my notes for third year BE/B.TECH classes

Institution
Course











Whoops! We can’t load your doc right now. Try again or contact support.

Connected book

Written for

Institution
Course

Document information

Uploaded on
May 2, 2023
Number of pages
159
Written in
2021/2022
Type
Class notes
Professor(s)
Mosh
Contains
All classes

Subjects

Content preview

PYTHON PROGRAMMING
[R17A0554]
LECTURE NOTES




SYLLABUS
L T/P/D C
3
OPEN ELECTIVE III
(R17A0554) PYTHON PROGRAMMING OBJECTIVES:
• To read and write simple Python programs.
• To develop Python programs with conditionals and loops.
• To define Python functions and call them.
• To use Python data structures –- lists, tuples, dictionaries.
• To do input/output with files in Python.
UNIT I
INTRODUCTION DATA, EXPRESSIONS, STATEMENTS
Introduction to Python and installation, data types: Int, float, Boolean, string, and list; variables,
expressions, statements, precedence of operators, comments; modules, functions--- function and its use,
flow of execution, parameters and arguments.

UNIT II
CONTROL FLOW, LOOPS
Conditionals: Boolean values and operators, conditional (if), alternative (if-else), chained conditional
(if-elif-else); Iteration: while, for, break, continue.

UNIT III
FUNCTIONS, ARRAYS
Fruitful functions: return values, parameters, local and global scope, function composition, recursion;
Strings: string slices, immutability, string functions and methods, string module; Python arrays, Access
the Elements of an Array, array methods.

,UNIT IV
LISTS, TUPLES, DICTIONARIES
Lists: list operations, list slices, list methods, list loop, mutability, aliasing, cloning lists, list parameters,
list comprehension; Tuples: tuple assignment, tuple as return value, tuple comprehension; Dictionaries:
operations and methods, comprehension;

UNIT V
FILES, EXCEPTIONS, MODULES, PACKAGES
Files and exception: text files, reading and writing files, command line arguments, errors and
exceptions, handling exceptions, modules (datetime, time, OS , calendar, math module), Explore
packages.


OUTCOMES: Upon completion of the course, students will be able to
Read, write, execute by hand simple Python programs.
• Structure simple Python programs for solving problems.
• Decompose a Python program into functions.
• Represent compound data using Python lists, tuples, dictionaries.
• Read and write data from/to files in Python Programs


TEXT BOOKS
1.Allen B. Downey, ``Think Python: How to Think Like a Computer Scientist‘‘, 2nd edition,
Updated for Python 3, Shroff/O‘Reilly Publishers, 2016. 2.R. Nageswara Rao, “Core Python
Programming”, dreamtech
3. Python Programming: A Modern Approach, Vamsi Kurama, Pearson

REFERENCE BOOKS:
1. Core Python Programming, W.Chun, Pearson.
2. Introduction to Python, Kenneth A. Lambert, Cengage
3. Learning Python, Mark Lutz, Orielly

, INDEX
UNIT TOPIC PAGE NO
INTRODUCTION DATA,
EXPRESSIONS, STATEMENTS
1
Introduction to Python and installation 1
data types: Int 6
float 7
Boolean 8
string 8
List 10
I
variables 11
expressions 13
statements 16
precedence of operators 17
comments 18
modules 19
functions ---- function and its use 20
flow of execution 21
parameters and arguments 26
CONTROL FLOW, LOOPS 35
Conditionals: Boolean values and 35
operators,
II conditional (if) 36
alternative (if-else) 37
chained conditional (if-elif-else) 39
Iteration: while, for, break, continue. 41
FUNCTIONS, ARRAYS 55
Fruitful functions: return values 55
parameters 57
local and global scope 59
function composition 62

, LISTS, TUPLES, DICTIONARIES 78
Lists 78
list operations 79
list slices 80
list methods 81
III recursion
list loop 63
83
Strings: string slices
mutability 64
85
IV immutability
aliasing 66
87
string
cloningfunctions
lists and methods 67
88
string module
list parameters 72
89
Python arrays
list comprehension 73
90
Access
Tuples the Elements of an Array 75
91
Array methods
tuple assignment 76
94
tuple as return value 95
tuple comprehension 96
Dictionaries 97
operations and methods 97
comprehension 102
V FILES, EXCEPTIONS, 103
MODULES, PACKAGES
Files and exception: text files 103
reading and writing files 104
command line arguments 109
errors and exceptions 112
handling exceptions 114
modules (datetime, time, OS , calendar, 121
math module)
Explore packages 134
$9.99
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
achu93456

Get to know the seller

Seller avatar
achu93456 bannari amman institute of technology
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
2 year
Number of followers
0
Documents
1
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

Frequently asked questions