Bapatla Engineering College: Unit - I
Bapatla Engineering College: Unit - I
Bapatla Engineering College: Unit - I
2. Program: B.Tech
• NIL
8. Syllabus
UNIT - I
(15 Periods)
Introduction: Overview, History of Python, Python Features, Environment Setup.
Variables, expressions, and statements: values and types, variables, 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.
Iteration: updating variables, the while statement, infinite loops and break, finishing
iterations with continue, definite loops using for, loop patterns.
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.
UNIT - II
(15 Periods)
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 I/O: 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, operations, slices, methods,
deleting elements, functions, strings, parsing lines, objects and values, aliasing, arguments.
Dictionaries: dictionary as a set of counters, dictionaries and files, looping and
dictionaries, advanced text parsing.
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.
1
UNIT - III
(15 Periods)
Regular expressions: character matching in regular expressions, extracting data using
regular expressions, combining searching and extracting, escape character.
ObjectOriented Programming: Managing Larger Programs, Using Objects, starting with
Programs, Subdividing a Problem: Encapsulation, First Python Object, Classes as Types,
Object Lifecycle, Many Instances, Inheritance.
UNIT - IV
(15 Periods)
Exception Handling: Errors and Exceptions(From Web References text 1).
Using Databases and SQL: Database concepts, Database Browser for SQLite, creating a
database table, Structured Query Language summary, Basic data modeling, Programming
with multiple tables, three kinds of keys, Using JOIN to retrieve data.
9. Course Objectives
1.1 Write scripts with basic python constructs and using control flow.
1.2 Identify the usage of functions and write scripts using functions.
2.1 Write scripts that can work on files and directories.
2.2 Use different data structures like tuples, lists and dictionaries.
3.1 Write scripts for performing searching using Regular expressions.
3.2 Write scripts with object oriented concepts like inheritance and encapsulation.
4.1 Handle exceptions while writing scripts using exception handling techniques in python.
4.2 Create python applications that can connect with database and perform CRUD
operations.
• Home Assignment ( HA )
• Surprise Tests ( ST )
• Mid Term Examinations ( MTE )
2
No. of Learning Teaching Assessment
Week Unit / module / Topic(s)
Periods Outcomes Methods Methods
Introduction, Variables, M1, M2 HA, ST &
1 7 1.1
Expressions and Statements & M3 MTE
Conditional execution and M1, M2 HA, ST &
2 8 1.2
Functions & M3 MTE
M1, M2 HA, ST &
3 7 2.1 File I/O, Strings
& M3 MTE
M1, M2 HA, ST &
4 8 2.2 Lists, Dictionaries and Tuples
& M3 MTE
M1, M2 HA, ST &
5 7 3.1 Regular Expressions
& M3 MTE
M1, M2 HA, ST &
6 8 3.2 Object Oriented Programing
& M3 MTE
M1, M2 HA, ST &
7 7 4.1 Exception Handling
& M3 MTE
M1, M2 HA, ST &
8 8 4.2 Using Database and SQL
& M3 MTE
14. Resources
[2] L. Perkovic, Introduction to Computing Using Python, 2nd ed. Wiley Publishers, 2015.
[3] G. van Rossum and F. L. D. Jr., Python Tutorial. Python Software Foundation, 2012.
[4] J. Guttag, Introduction to Computation and Programming using Python. PHI Publisher, 2012.