![](https://stalwartlearning.com/wp-content/uploads/2023/07/Custom-dimensions-300x294-px-13.png)
Python Training
Duration : 4 Days
Date : 07, 08, 09, 10 Feb 2024
Overview
In this course, you will get started with using Python 3. We will start by helping you get Python installed on your computer. You will then be introduced to Jupyter Notebooks – an interactive way to learn Python. We will use a practical, hands-on approach to help you learn the structure of Python. We will cover the various mathematical and string operations, in addition to Python’s various data structures. You’ll also get started on how to effectively communicate in Python using statements and how to use .py files. We’ll then move forward to learn about Functions, Methods, and Object Oriented Programming in Python and its advantages.
Importantly, there will be 3 Milestones that you’ll implement along the way to ensure understanding.
- Install Python
- Learn the Python programming language by doing hands-on activities
- Learn about Jupyter (iPython) notebooks and how they are used
- Learn the unique features of Python and why it has become so popular
- Learn many of the ways in which Python is used (e.g., data science, web development, database access)
- Learn Object Oriented Programming with Python classes
- Understand how Python can be used on personal and professional projects
Prerequisites
Little knowledge of programming would be helpful to attend this training.
Lab Setup
HW : 1 Laptop/Desktop per participants with minimum 8GB RAM and 100 GB Disk Space
OS : Any
SW :
- Python – 3.8.5
Download link: https://www.python.org/downloads/release/python-385/
2. Code Editor or IDE
A) Sublime Text 3
Download link: https://www.sublimetext.com/3
B) IDLE
It is built-in editor with Python.
[Note: PyCharm, VS Code or Jupyter Notebook can also be used by the participants, if
desired.]
Course Contents
PHASE 1
Basic Concepts
• fundamental concepts: interpreting and the interpreter, compilation and the compiler, language
elements, lexis, syntax and semantics, Python keywords, instructions, indenting
• literals: Boolean, integer, floating-point numbers, scientific notation, strings
• comments
• the print() function
• the input() function
• numeral systems (binary, octal, decimal, hexadecimal)
• numeric operators: ** * / % // + –
• string operators: * +
• assignments and shortcut operators
Data Types, Evaluations, and Basic I/O Operations
• operators: unary and binary, priorities and binding
• Boolean operators: not and or
• Boolean expressions
• relational operators ( == != > >= < <= ), building complex Boolean expressions
• accuracy of floating-point numbers
• basic input and output operations using the input(), print(), int(), float(), str(), len() functions
• formatting print() output with end= and sep= arguments
• type casting
• basic calculations
• simple strings: constructing, assigning, indexing, slicing comparing, immutability
Flow Control – loops and conditional blocks
• conditional statements: if, if-else, if-elif, if-elif-else
• multiple conditional statements
• the pass instruction
• building loops: while, for, range(), in
• iterating through sequences
• expanding loops: while-else, for-else
• nesting loops and conditional statements
• controlling loop execution: break, continue
Data Collections – Lists, Tuples, and Dictionaries
• simple lists: constructing vectors, indexing and slicing, the len() function
• lists in detail: indexing, slicing, basic methods (append(), insert(), index()) and functions (len(),
sorted(), etc.), del instruction, iterating lists with the for loop, initializing, in and not in operators,
list comprehension, copying and cloning
• lists in lists: matrices and cubes
• tuples: indexing, slicing, building, immutability
• tuples vs. lists: similarities and differences, lists inside tuples and tuples inside lists
• dictionaries: building, indexing, adding and removing keys, iterating through dictionaries as well
as their keys and values, checking key existence, keys(), items() and values() methods
• strings in detail: ASCII, UNICODE, UTF-8, immutability, escaping using the \ character, quotes
and apostrophes inside strings, multiline strings, copying vs. cloning, advanced slicing, string vs
string, string vs. non-string, basic string methods (upper(), lower(), isxxx(), capitalize(), split(),
join(), etc.) and functions (len(), chr(), ord()), escape characters
Functions
• defining and invoking your own functions and generators
• return and yield keywords, returning results,
• the None keyword,
• recursion
• parameters vs. arguments,
• positional keyword and mixed argument passing,
• default parameter values
• converting generator objects into lists using the list() function
• name scopes, name hiding (shadowing), the global keyword
Lambda and recursive functions
• lambda functions
• First class objects and higher order functions
• map and filter functions
• functools and reduce functions
• Recursive functions
Modules and packages
• Python modules and module namespace
• import and from … import
• Python module path and PYTHONPATH
• dir() and help() functions
• Python packages and init .py file
File Handling
• Introduction to files
• File objects and modes
• Opening and closing files
• Read and write operations
• Context manager – with
Working with directories
• Directories and file path
• os module
• Making, changing and deleting directories
• Listing directory and navigating file systems
• Data compression and decompression with zipfile module
Advance file handling
• Working with CSV (comma separated value) files
• Using pandas module to read excel and csv data
• pickle module, pickling and unpickling
• Introduction to web scraping
• Web scraping with urllib and BeautifulSoup Section 11: XML and JSON parsing
• What are xml files?
• Making XML files with custom tags
• XML parsing with etree
• What is JSON?
• Use of JSON in RestAPI
• JSON parsing – dump and load methods
Errors & Exception handling
• What are error and exceptions?
• How exceptions are caused?
• Decoding the Traceback message
• Handling exceptions with – try, except, raise and assert
• Causing exceptions with – raise and assert
• Creating your own exception class
Logging and debugging
• Introduction to logging module
• logging levels
• logging configuration
Regular expressions
• Introduction to re module
• Special characters for pattern making
• re functions and flags
• String matching and pattern filtering
• Greedy and non-greedy match
• Expressions using operators and symbols
• Simple character matches
• Special characters
• Mobile number extraction
• Mail extraction
• Different Mail ID patterns
• Data extraction
• Password extraction
• URL extraction
• Vehicle number extraction
• Case study
Training outcome:
Participant should have acquired proficiency in python scripting related to file handling, exception
handling, logging and debugging, string matching and regular expression etc.
Sample projects at intermediate level proficiency:
Project 1 : Data compression and decompression
Use case: Zip multiple file into a together and unzip the files from zip into the path required.
Project 2: Filter data from log file based on pattern
Use case: Analyze the log file for error logs with specific attributes and filer the data as per a specified
pattern.
Database connectivity
• Introduction to SQL database
• Common SQL query
• Connecting with sqlite3 database and making cursor object
• CREATE, INSERT, SELECT, UPDATE and DROP query
• commit and rollback mechanisms
Classes, objects, and threads
• Introduction to object oriented programming
• Class variables and instance variables
• Use of self and init ()
• Class attributes
• Best practices in object oriented programming – pylint Section 17: OOPs concepts
• Object oriented programming techniques in python
• Inheritance and types of inheritance
• Overriding and overriding rules
• Method overloading or polymorphism
• Operator overloading
Multi-threading & Multi-Processing
• Introduction
• Multi tasking v/s Multi threading
• Threading module
• Creating thread – inheriting Thread class , Using callable object
• Life cycle of thread
• Need to start() method
• Sleep()
• Join()
• Synchronization – Lock class – acquire(), release() functions
Sample projects at advanced level proficiency:
Project 1: MIS (Management Information System)
Use case: Use python data types and loops with SQL databases to create a management information
system that can keep records and process them.
Project 2: Mass mailing application
Use case: Use python scripts to send email in bulk to large group of target audience. It also involves
mining recipient email id from CSV file.