31.5 - Python Syllabus
31.5 - Python Syllabus
31.5 - Python Syllabus
SASTRA University
Item No.:31.5
UNIT I 15 Periods
Numeric Types: Basics-Numbers in action-Other Numeric Types. String Fundamentals:
Basics-Literals - Strings in Action-Methods- Formatting Expressions String Formatting method
calls. List and Dictionaries: Lists-Lists in action-Dictionaries-Dictionaries in Action. Tuples,
Files: Tuples in Action-Need for Lists and Tuples-Files. Assignments, Expression and Print:
Assignment Statements, Expression Statements, Print Operations. If Tests: if statements-Block
and statement delimeters -Truth values and Boolean Tests-Ternary expression. While and for
loops: While loops-break, continue, pass and the Loop else-for loops-Loop Coding Techniques.
Iterations and Comprehensions: Iteration Protocol-Manual iteration-Other Built-in Type
Iterables-List Comprehensions-Other Iteration contexts-Other Iterables in Python 3.X.
UNIT II 15 Periods
Function Basics: Coding Functions. Scopes: Python Scope Basics-global statement-Scopes
and Nested functions-Non local statement in Python 3.X-Need for non local. Arguments:
Argument passing basics-Special Argument Matching Modes-Generalized Set functions-Python
3.X print function emulation. Advanced Function topics: Function Design Concepts-
Recursive Functions-Attributes and Annotations-Anonymous functions: lambda-Functional
Programming tools. Comprehensions and Generations: List Comprehension and Function
Tools-Generator functions and expressions. Benchmarking Interlude: Timing Iteration
alternatives - Python with timeit-pystones Function Gotchas. Module Coding basics:
Creation-Usage-Name spaces-Reading modules. Module Packages: Package import basics-
Need for package imports.
192
XXXI Academic Council Meeting
SASTRA University
UNIT IV 15 Periods
Introduction to Django: MVC Design pattern-History of Django. The Django Template
System: Basics-Use-Basic template tags and filters-Limitations-Using Templates in views-
Template loading and inheritance. Interacting with a Database: MTV Development pattern-
Configuring the database-Defining models in Python-Installing the model-Basic data access-
Adding String Representations-Inserting and updating data-Selecting and deleting objects-
Making changes to a Database Schema. Django Administration Site: Activating the Admin
Interface-Using Admin Interface-Customizing Admin Interface. Form Processing: Creating a
feedback form-Processing the submission-Cross Validation-Customization-Creating forms from
Models.
TEXT BOOKS
1. Mark Lutz, Learning Python, 5th Edition, OReily Media, 2013. (Unit I, II and III)
2. Adrian Holovoty, Jacob Kaplan-Moss, The Definitive Guide to Django: Web Development
Done Right, Second Edition, Apress, 2009. (Unit IV).
REFERENCES
LEARNING OUTCOMES
UNIT- I Memorize the syntax of basic Datatypes, List, Dictionaries, Tuples, Files,
operators, branching and looping constructs. Select an appropriate data type and
programming construct to solve the given problem
UNIT - II Illustrate modules, basic and advanced functions
UNIT - III Demonstrate the use of class and exception handling. Also demonstrate operator
overloading
UNIT- IV Develop web applications using Django web framework
193