This is an online textbook on Python and is a companion resource to the course Programming in Python
offered as a part of the Online Degree Program, IIT-Madras. For more details about the course, check out our website.
Note to students: This book is meant to be used as a reference. You may find content that has not been covered in the video lectures. Likewise, there may be some content that is present in the lectures which is not covered here. Additional content appearing in this book will not be considered for grading. In summary, please refer to chapters that you feel are relevant for the course. But you are under no obligation to read the entire book cover to cover. Interested students are always welcome to read the entire thing!
Programming in PythonChapter-0: Warm-upChapter-1: Introduction to PythonChapter-2: ConditionalsChapter-3: LoopsChapter-4: FunctionsChapter-5: Lists and TuplesChapter-6: Dictionaries and SetsChapter-7: File HandlingChapter-8: Object Oriented Programming
Strings
Strings
Conditional Statements
if
if-else
if-elif-else
Nested Conditional Statements
Defining Variables inside if
System libraries
calendar
time
this
while
loopbreak
, continue
for
looprange()
Nested loops
while
versus for
print
end
sep
Formatted printing
format()
Format Specifiers
System libraries
math
random
Mathematics and Programming
Arguments
Call by Value
Scope
Namespaces
Scope and Namespaces
Lists
Lists
Lists
Lists
List Methods
Stack and Queue
Strings and Lists
split
join
Lists
Tuples
Dictionaries
Text Processing
Dictionaries
Dictionaries in Action: LMS
Sets
File Handling
File Handling
File Handling
File Handling
File methods
read
readline
readlines
write
writelines
File Handling
CSV files
self