Python Syllabus

SUBJECT CODE: 15CS35 No. of Credits:4:0:0:0 No. of Lecture hours per week:4
Exam Duration :3 hours Exam Marks: 100 Total No. of Lecture hours: 52


Course Objectives:

The objective of the course is to:

  1. Learn Syntax and semantics and create Functions in Python.
  2. To handle Files, Lists and Dictionaries in Python.
  3. Understand Regular expressions and Object Oriented Programming in Python.
  4. Construct Data Structures using Python.
  5. Build Web Services and Introduction to Network Programming in Python.
Unit No Python Syllabus Content No. of


1 Why should you learn to write programs Creativity and motivation, Computer hardware architecture, Understanding programming, Words and sentences, Conversing with Python, Terminology: interpreter and compiler, Writing a program, What is a program? The building blocks of programs, What could possibly go wrong? The learning journey. Variables, expressions and statements, Values and types, Variables, Variable names and keywords, Statements, Operators and operands, Expressions, Order of operations, Modulus operator, String operations, Asking the user for input, Comments, Choosing mnemonic variable names, Conditional execution, Boolean expressions, Logical operators, Conditional execution, Alternative execution, Chained conditionals, Nested conditionals, Catching exceptions using try and except, Short circuit evaluation of logical expressions, Functions, Function calls, Built-in functions, Type conversion functions, Random numbers, Math functions, Adding new functions, Definitions and uses, Flow of execution, Parameters and arguments, Fruitful functions and void functions, Why functions? 10

Iteration, Updating variables, The while statement, Infinite loops, “Infinite loops” and break, Finishing iterations with continue, Definite loops using for, Loop patterns, Strings, A string is a sequence, Getting the length of a string using len, Traversal through a string with a loop, String slices, Strings are immutable, Looping and counting, The in operator, String comparison, string methods, Parsing strings, Format operator, Files, Persistence, Opening files, Text files and lines, Reading files, Searching through a file, Letting the user choose the file name, Using try, except, and open, Writing files, Lists, A list is a sequence, Lists are mutable, Traversing a list, List operations, List slices, List methods, Deleting elements, Lists and functions, Lists and strings, Parsing lines, Objects and values, Aliasing, List arguments, Dictionaries, Dictionary as a set of counters, Dictionaries and files, Looping and dictionaries, Advanced text parsing           

3 Tuples, Tuples are immutable, Comparing tuples, Tuple assignment, Dictionaries and tuples, Multiple assignment with dictionaries, The most common words, Using tuples as keys in dictionaries, Sequences: strings, lists, and tuples, Regular expressions, Character matching in regular expressions, Extracting data using regular expressions, Combining searching and extracting, Escape character. Classes and objects, User-defined compound types, Attributes, The initialization method and self, Instances as parameters, Classes and functions, Time, Pure functions, Modifiers, Prototype development versus planning, Generalization, Classes and methods, Object-oriented features, print_time, Another example, A more complicated example, Optional arguments, The initialization method, Points revisited, Operator overloading, Polymorphism 11

Linked lists, Embedded references, The Node class, Lists as collections, Lists and recursion, Infinite lists, The fundamental ambiguity theorem, Modifying lists, Wrappers and helpers, The Linked List class, Invariants, Stacks, Abstract data types, The Stack ADT, Implementing stacks with Python lists, Pushing and popping, Using a stack to evaluate postfix, Parsing, Evaluating postfix, Clients and providers, Queues, The Queue ADT, Linked Queue, Performance characteristics, Improved Linked Queue, Priority queue, The Golfer class


Networked programs, Hypertext Transport Protocol – HTTP, The World’s Simplest Web Browser, Retrieving an image over HTTP, Retrieving web pages with urllib, Parsing HTML and scraping the web, Parsing HTML using Regular Expressions, Parsing HTML using BeautifulSoup, Reading binary files using urllib, Using Web Services, eXtensible Markup Language – XML, Parsing XML, Looping through nodes, JavaScript Object Notation – JSON, Parsing JSON, Application Programming Interfaces (API), Automating common tasks on your computer, File names and paths, Example: Cleaning up a photo directory, Command line arguments, Pipes



  • Charles Severance, “Python for Informatics”, 1st Edition, CreateSpace Independent Publishing Platform, 2013.
  • Peter Wentworth, Jeffrey Elkner, Allen B. Downey, and Chris Meyers, “How to Think Like a Computer Scientist: Learning with Python”, 2nd Edition, Open Book Project, 2012

Reference Books:

  • Mark Lutz, “Learning Python”, 5th Edition, O’Reilly Media, 2013.
  • Wesley Chun, “Core Python Applications Programming”, Prentice Hall, 3rd Edition, 2012
  • Alex Martelli, ”Python in a Nutshell”, 2nd Edition, O’Reilly Media, 2006

 NOTE: One question each from units 1, 2 and 4.

               Two questions from unit-3

               Two questions from unit-5

 Course Outcomes:

At the end of the course the student will be able to:

  1. Exposed to Python syntax and semantics and be fluent in the use Python flow control and functions.
  2. Create and run Python Programs using Lists, Dictionaries and handle File Systems.
  3. Understand the concepts of Regular Expressions and Object-Oriented programming as used in Python.
  4. Build Data Structures using Python.
  5. Gentler Introduction to Network Programming and Web Services in Python.

Following were the reasons to introduce this subject.

  1. Students should be able to learn and program an easier language and express their thoughts without any sort of hindrance.
  2. Students are given a basic introduction to Object Oriented Programming (OOP) Concepts.
  3. This helps the students to understand OOP concepts in other programming languages like C++, Java and C#.
  4. Students are also introduced gently to various important concepts like HTTP, JSON and XML.

Another highlight is, in keeping with the spirit of Open Source we have recommended freely available books as text books.

Finally, I would like to Thank all the authors for making their awesome books available online for free.


Leave a Reply

Your email address will not be published. Required fields are marked *