Video Training Python
Connect with me: Youtube | LinkedIn | WhatsApp Channel | Web | Facebook | Twitter
- Download PDF
-
To access the updated handouts, please click on the following link: https://yasirbhutta.github.io/python/video-training-python.html
- Download Example Code
- Python Playlist on Youtube
Installation & Getting Started
- Get Started Tutorial for Python in Visual Studio Code
- Python in Visual Studio Code
- Hello World
- How to: Install Jupyter Notebook on an Android device
- Learn How to Copy Code from Social Media Images Like a Pro
Python Exercises
Python Language Basics
Print() Function:
Comments:
Indentation:
Variables and Assignments
- Video: Variables in Python
- Vide: Python Variables and Assignment
- Video: Asterisk (*) in Variable Assignment (New)
Local and Global Variables:
-
Python Challenge to test your knowledge Quiz #1
Python Quiz - Variables
Data Types
str:
- Find Occurrences in Strings Effortlessly with Python’s Count Method
- How to Replace the Second Occurrence of a Character in a String
- String swapcase() Method
Python str examples:
Python Quiz -String
int:
- How to use int variable
- int variable
- How to Convert a Python String to int
- How to Convert a Python integer to string
- Convert integer to octal and hexadecimal
float:
bool:
Operators
1. Arithmetic Operators:
2. Comparison Operators: 3. Assignment Operators: 4. Logical Operators:
5. Identity Operators:
6. Membership Operators:
7. Bitwise Operators:
Python operators examples:
Functions
- How to Add Two Numbers and Print the Result
- Learn How to Use Default Parameters in Function Definition
- Understanding *args in Functions - How to Add Any Number of Arguments with *args
- How to Use *args in Python Functions
- How to use **kwargs in Python
Python def examples:
- example #1: How to Write a Python Function to Find the Length of a Word
- example #2: How to Find the Maximum Value in a List of Numbers
Anonymous (Lambda) Functions
Python lambda examples:
Generators
Python generator examples:
Control Flow Statements
if Statement
- How to check if a number is odd or even
- Python Program to Find Grade of a Student Using if elif else
- Use Walrus Operator with if-else (New)
- How to Write Single-Line Code Instead of If-Else Statements (New)
Python Quiz -IF
for Statement
while Statement
while loop examples:
- How to Count Digits in a Positive Integer using Python
- How to Count Occurrence of a Specific Digit in a Number using Python
The Range() function
The break and continue Statement
The else Clauses on Loops
pass Statement
match Statement
Data Structures and Sequences
Tuple:
- #1 Tuple Assignment
- #2 Tuple Assignment
- How to create a tuple in Python
- Learn how to print elements of a tuple
- How to Calculate the Sum of a Tuple Using a For Loop
- How to create an Empty tuple and Single value tuple
- How to: Access Tuple Items in Python
list
- How to use list
- Python List Slicing
- Python Nested List
- How to modify a list by replacing multiple elements with a single element
- Adding and Removing Elements from a Python List
- Check if Data Structure is Empty Using ‘not’ Operator
- Remove duplicate elements from a list
List Methods:
Built-in Sequence Functions:
- #1 Python zip() Function
- #2 Python Zip Function: Handling Lists with Different Numbers of Elements
- Python Iterators and Iterables: How to Loop Over Lists and Iterators
- How to Iterate Over Tuples with the Enumerate Function
- Python example: Finding the maximum value in a list using a one-liner
- Python example: Find the sum of all even numbers between 1 and 100 using a one-liner
- Python example: Counting the number of occurrences of an element in a list
dict
- Use of dict
- How to Print a Dictionary
- Python Dictionary with For Loop
- How to Merge Dictionaries with the | Operator
dict Methods:
set
- How to: Add or Remove Elements in a Set
- How to: Create Empty Set in Python
- Find the Union of Two Sets in Python
List, Set and Dict Comprehensions
List comprehension examples:
- List Comprehension with Easy-to-Understand Code Example
- Create a list of squares of all even numbers
- How to Convert List Elements to Upper Case
- How to: Use list comprehension for DATA CLEANING
- Python Challenge to test your knowledge Quiz1 Quiz2 Quiz3
Python Sorting
Python sorting examples:
- example #1: Sorting a List of Colors by Length using Python’s sorted() Function
- example #2: How to Sort a List of Fruit Tuples
- example #3: Sorting a List of Dictionaries by Age using Lambda Function
Error and Exception Handling
Python Performance
- List vs Tuple Memory Usage Comparison using sys module
- Performance Comparison of For Loop vs List Comprehension
Python in Excel
Classes - Object Oriented Programming
- How to Create a Class in Python
- What is Class Constructor
- Python Attributes: Class and Instance Attribute Example
Modules
Numpy
-
[#1 NumPy How to Create 1D, 2D, and 3D Arrays in NumPy](https://youtu.be/08PDFhQhnNg) -
[#2 NumPy Python NumPy Array Creation Methods Explained Zeros, Ones, Empty, Arange, and Linspace](https://youtu.be/PI4UegrAYxs) -
[#3 NumPy Python Array Dimensions: Understanding Shape and Size @yasirbhutta](https://youtu.be/UIGM_suK5cI) - #4 Python NumPy Tutorial: Reshape an Array
- #5 Python NumPy Tutorial: Indexing and Slicing
- #6 Python NumPy Tutorial: Vertically and Horizontally Stack Arrays with vstack and hstack
- #7 Python NumPy Tutorial: Mastering Arithmetic and Logical Operations for Efficient Data Processing
-
[#8 NumPy Matrix Multiplication using NumPy in Python](https://youtu.be/6IAOoMDbxMM) -
[#9 NumPy Matrix Transpose using NumPy in Python](https://youtu.be/sF6aK9edzBQ) -
[#10 NumPy Inverse of a Matrix in Python with NumPy](https://youtu.be/u4jBU1DYSPU) - #11 Python NumPy: How to Find Unique Values in an Array
- #14 Python NumPy Tutorial: 3 Ways to Use a Random Generator
Numpy in Python examples:
- How to Handle Missing Values in NumPy with Masked Arrays
- Generate a Random Number Between 0 and 1 in #Python with #NumPy