|SUBJECT TITLE: PYTHON PROGRAMMING|
|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|
The objective of the course is to:
- Learn Syntax and semantics and create Functions in Python.
- To handle Files, Lists and Dictionaries in Python.
- Understand Regular expressions and Object Oriented Programming in Python.
- Construct Data Structures using Python.
- 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, Deﬁnitions and uses, Flow of execution, Parameters and arguments, Fruitful functions and void functions, Why functions?||10|
Iteration, Updating variables, The while statement, Inﬁnite loops, “Inﬁnite loops” and break, Finishing iterations with continue, Deﬁnite 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 ﬁles, Text ﬁles and lines, Reading ﬁles, Searching through a ﬁle, Letting the user choose the ﬁle name, Using try, except, and open, Writing ﬁles, 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 ﬁles, 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
- 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
- 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
At the end of the course the student will be able to:
- Exposed to Python syntax and semantics and be fluent in the use Python flow control and functions.
- Create and run Python Programs using Lists, Dictionaries and handle File Systems.
- Understand the concepts of Regular Expressions and Object-Oriented programming as used in Python.
- Build Data Structures using Python.
- Gentler Introduction to Network Programming and Web Services in Python.
Following were the reasons to introduce this subject.
- Students should be able to learn and program an easier language and express their thoughts without any sort of hindrance.
- Students are given a basic introduction to Object Oriented Programming (OOP) Concepts.
- This helps the students to understand OOP concepts in other programming languages like C++, Java and C#.
- 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.