Python Programming

AICTE Sponsored and Prescribed [Downloaded 25000 times]

This is the book's webpage, which lists material to supplement your learning.
  • All the code from the book
  • To encourage free education, the book is available free for download from AICTE (needs registration with mobile number and OTP) [Download here].
  • Answers to book's exercises: If you are a faculty member, you can write to me at from your official email id, and I will share the exercise answers (developed by Sanjith Surya from VIT).
After learning through this book, if you have developed a set of utilities, interesting programs, or projects, which you would like to share with others, please feel free to write to me at I will be happy to list those here if I find those useful.

Salient Features

  • No programming background necessary
  • Example-driven problem-solving approach (probability of a card, blood group matching, ...)
  • Gradually added complexity (lucky cards, all prime numbers in a range, ...)
  • Solved and unsolved exercises
  • QR code points to all the programs (over 100 programs in five units)

Sample programs from the book

Unit 1: Introduction, Variables, and Data Types Unit 2: Control Structures Unit 3: Functions, Modules, and Packages Unit 4: Files and Regular Expressions Unit 5: Django Framework
  • Probability of a card
  • Sum of first N numbers
  • Extracting fields of a roll number
  • Word shuffle
  • Matching blood group
  • Find student from a dept.
  • Lucky cards
  • Pass % of a class
  • Fibonacci numbers
  • Collatz sequence
  • Primality testing
  • Birthdays in a month
  • Exact change
  • Perfect numbers
  • Fibonacci strings
  • Recursive list printing
  • Binary search
  • Track academic performance
  • Matrix operations
  • Tic-tac-toe
  • Print file contents
  • Copy a file
  • Split text into words
  • Join words to form sentences
  • Find and replace
  • Extract academic record
  • Track friends‘ information
  • Conference registration
  • Find all mobile numbers
  • Find all email addresses
  • Display an HTML file
  • Display academic record
  • Create personal webpage

Errata, Clarifications, and Suggestions
SectionTextCommentSuggested by
----Introducing helpers like argparser could be useful,
covering compiled python code (.pyc) files could be useful as well.
Rahul Fiske, IBM
1.8List and Tuple are marked as Unordered.List and Tuple should be marked as Ordered. Set is an example of an Unordered data type.Dr. N Srikanth Reddy, Presidency University

Other information