[Go to site: main page, start]

0% found this document useful (0 votes)
48 views3 pages

Introduction to Python Programming

Uploaded by

yashu25143
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views3 pages

Introduction to Python Programming

Uploaded by

yashu25143
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Computer Applications 2022

INTRODUCTION TO PYTHON PROGRAMMING

Course Code: 22CA3102 LTPC

2 00 2

COURSE OUTCOMES:
At the end of the course, student will be able to
CO1: Examine Python syntax and semantics and be fluent in the use of Python flow control and
functions. (L3)
CO2: Express proficiency in the handling of strings and functions.(L3)
CO3: Determine the methods to create and manipulate Python programs by utilizing the data
structures like lists, dictionaries, tuples and sets.(L3)
CO4: Identify the commonly used operations involving file systems and regular
expressions.(L3)
CO5: Understand the Object-Oriented Programming concepts such as encapsulation, inheritance
and polymorphism as used in Python.(L2)

UNIT –I: (10 Lectures)


Parts of Python Programming Language, Identifiers, Keywords, Statements and Expressions,
Variables, Operators, Precedence and Associativity, Data Types, Indentation, Comments, Reading
Input, Print Output, Type Conversions, The type() Function and Is Operator, Dynamic and Strongly
Typed Language, Control Flow Statements, The if Decision Control Flow Statement, The if…else
Decision Control Flow Statement, The if…elif…else Decision Control Statement, Nested if
Statement, The while Loop, The for Loop, The continue and break Statements, Catching Exceptions
Using try and except Statement, Functions, Built-In Functions, Commonly Used Modules, Function
Definition and Calling the Function, The return Statement and void Function, Scope and Lifetime of
Variables, Default Parameters, Keyword Arguments, *args and **kwargs, Command Line
Arguments.

Learning Outcomes:
At the end of the module, students will be able to
● Summarize features of python programming(L2)
● Use various data types and control statements in python(L3)

UNIT-II: (10 Lectures)


Strings, Creating and Storing Strings, Basic String Operations, Accessing Characters in String by
Index Number, String Slicing and Joining, String Methods, Formatting Strings, Lists, Creating
Lists, Basic List Operations, Indexing and Slicing in Lists, Built-In Functions Used on Lists, List
Methods, The del Statement.

Learning Outcomes:
At the end of the module, students will be able to
● Explain strings, operations (L2)
● understand the concept lists, List Methods.(L3)
● understand and apply the concept of slicing and indexing(L3)
Computer Applications 2022

UNIT-III: (10 Lectures)


Dictionaries, Creating Dictionary, Accessing and Modifying key:value Pairs in Dictionaries, Built-
In Functions Used on Dictionaries, Dictionary Methods, The del Statement, Tuples and
Sets, Creating Tuples, Basic Tuple Operations, Indexing and Slicing in Tuples, Built-In Functions
Used on Tuples, Relation between Tuples and Lists, Relation between Tuples and Dictionaries,
Tuple Methods, Using zip() Function, Sets, Set Methods, Traversing of Sets, Frozenset.

Learning Outcomes:
At the end of the module, students will be able to
● Demonstrate use of dictionaries (L2)
● Illustrate Built in functions , methods in dictionaries(L3)

UNIT-IV: (10 Lectures)


Files, Types of Files, Creating and Reading Text Data, File Methods to Read and Write Data,
Reading and Writing Binary Files, The Pickle Module, Reading and Writing CSV Files, Python os
and [Link] Modules, Regular Expression Operations, Using Special Characters, Regular
Expression Methods, Named Groups in Python Regular Expressions, Regular Expression with glob
Module.

Learning Outcomes
At the end of the module, students will be able to
● Understand the concept of Files (L2)
● Understand and analyze regular Expression operations(L3)

UNIT-V: (10 Lectures)


Object-Oriented Programming, Classes and Objects, Creating Classes in Python, Creating
Objects in Python, The Constructor Method, Classes with Multiple Objects, Class Attributes versus
Data Attributes, Encapsulation, Inheritance, The Polymorphism
Learning Outcomes
At the end of the module, students will be able to
● Summarize Object oriented Programming features(L2)
● understand the constructor method (L2)

TEXT BOOKS:
1. Gowrishankar S, Veena A, “Introduction to Python Programming”, 1st Edition, CRC Press
/Taylor & Francis, 2018. ISBN-13: 978-0815394372
Computer Applications 2022

REFERENCE BOOKS:

1. Jake VanderPlas, “Python Data Science Handbook: Essential Tools for Working with
Data”, 1st Edition, O'Reilly Media, 2016. ISBN-13: 978-1491912058
2. AurelienGeron, “Hands-On Machine Learning with Scikit-Learn and TensorFlow:
Concepts, Tools, and Techniques to Build Intelligent Systems”, 1st Edition,O'Reilly Media,
2017. ISBN – 13: 978-1491962299.
3. Wesley J Chun, “Core Python Applications Programming”, 3rd Edition, Pearson Education
India, 2015. ISBN-13: 978-9332555365
4. Miguel Grinberg, “Flask Web Development: Developing Web Applications with
Python”, 2nd Edition, O'Reilly Media, 2018. ISBN-13: 978-1491991732.

WEB REFERENCES:

 [Link]
 [Link]
 [Link]
 [Link]

Common questions

Powered by AI

The `try` and `except` statement in Python allows for structured error handling. By dividing the code into a block where exceptions can occur ('try') and a block to handle exceptions ('except'), the program can continue running even if unexpected errors occur. This enhances robustness and user experience by preventing abrupt terminations and allowing developers to provide fallback solutions or log error information for debugging .

The `os` module in Python provides a portable way to use operating system-dependent functionality like file and directory operations. It enables tasks such as navigating directory trees, creating, and deleting files and directories, and accessing system environmental variables. Integration into program workflows allows scripts to dynamically interact with the operating system's file system, automate tedious manual tasks, and enhance cross-platform compatibility by abstracting system-specific differences .

Python sets allow for operations such as union, intersection, and difference, which are valuable for tasks that require mathematical and logical data comparisons like finding distinct elements or commonalities between datasets. The `frozenset`, being immutable, provides a secure way to maintain a collection of items that should not be altered during program execution, thus serving as reliable storage for key data points in a dictionary or as elements in a set .

Encapsulation in Python’s OOP model helps in maintaining code integrity by restricting access to an object's internal state and behavior from outside intervention. It is implemented through access modifiers like private and protected variables. This ensures that object data can only be modified through well-defined interfaces, promoting modularity, ease of maintenance, and protecting against unintended interference and misuse from external code segments .

Dictionaries in Python store key-value pairs, allowing for the associative storage of data, unlike lists which store ordered collections of elements. Dictionaries offer the advantage of fast lookups, updates, and deletions due to their hash-table implementation, making them optimal for scenarios requiring quick access to data based on key identifiers, such as caching, memoization, or scenarios where data needs to be organized by clear, meaningful keys rather than index positions .

Regular expressions are highly efficient and powerful for pattern matching and text manipulations in Python, supporting complicated search-and-replace operations with concise expressions. They are beneficial for parsing complex text patterns, validating strings, and extracting information from text data. However, they can become difficult to read and maintain, especially with complex expressions, and extensive use may impact readability and performance due to their computational intensity .

List indexing and slicing in Python allow for efficient data manipulation by accessing and modifying list elements with precision. Indexing retrieves specific items using their positions, while slicing provides a way to extract sublists by defining start and end points. This functionality is crucial for tasks such as data segmentation, subset creation, and iterative modification processes, often simplifying complex data manipulation problems .

Default parameters in Python allow functions to have pre-specified values if no arguments are provided, thereby simplifying function calls and reducing code verbosity. The use of *args enables functions to accept a variable number of arguments, enhancing flexibility by allowing a function to handle different types and numbers of inputs without changing its definition, thus making it adaptable to various contexts and use cases .

Class attributes are variables defined within a class that are shared across all instances, meaning that any change made to this attribute affects all instances of the class. Instance attributes are unique to each object instance, allowing objects to maintain state independently. This differentiation influences design decisions; class attributes are useful for constants and shared data across instances, while instance attributes provide individualized data handling for each object .

Python being dynamically typed means that the type of a variable is interpreted at runtime, which provides flexibility in code but requires careful management of variable types to avoid runtime errors . Strong typing in Python implies that even though it is dynamic, operations between incompatible types result in errors, enforcing type safety and caution among programmers. These characteristics encourage practices like type checking and defining clear interfaces and contracts in code .

You might also like