Python Tutorial

Last updated : December 18, 2023

What is Python?

Python is an object-oriented, high-level, interpreted programming language with dynamic semantics. It has a rich set of high-level in-built data structures (data types) which are combined with dynamic typing and data typing. It makes Python a very popular and attractive programming language for rapid application development, and scripting. It is simple, easy to learn, and readable and Python's codes are smaller than codes of other programming languages like C, C++, Java, etc. The codes and relatively less indented which make the code readable/editable for the programmers all the time.

The Python Tutorial

In this Python tutorial, we covered almost all topics starting from basics to advanced topics like Machine learning with Python, Python Pandas, and Python Data Science, this Python tutorial is specifically designed for beginners and professionals.

Python Tutorial Topics

Python Overview

  1. Introduction to Python
  2. Why is python so popular?
  3. Virtual Environment for Python based application
  4. Install pip on MacOS or OSx
  5. Executing first program on Python in Different Modes
  6. What does if __name__ == '__main__': do in Python?
  7. What __init__ and self do in Python?
  8. Python | How to upgrade all Python packages with pip?

Python Basics

  1. Python Keywords
  2. Python built-in keywords with examples
  3. Python keywords Reference
  4. Python Built-in Functions
  5. Comments in Python
  6. Block Comments in Python
  7. How do we create multiline comments in Python?
  8. How to read/process command line arguments in Python?

Python Data Types

  1. Python Variables: An Easy Guide With Examples
  2. Python Data Types (Complete List, Types, and Examples)
  3. Python Numeric Types
  4. How to determine a Python variable's type?
  5. Python type() Method (With Examples)

Python Input/Output

  1. Python print() function
  2. Input and Output Operations with Examples in Python
  3. Taking multiple inputs from the user using split() method in Python
  4. Fast input / output for competitive programming in Python
  5. Precision handling in Python
  6. Python print() function with end parameter
  7. sep parameter in Python with print() function
  8. file parameter in Python with print() function
  9. flush parameter in Python with print() function
  10. Print multiple variables in Python
  11. Asking the user for integer input in Python | Limit the user to input only integer value
  12. Asking the user for input until a valid response in Python
  13. Input a number in hexadecimal format in Python
  14. Input a number in octal format in Python
  15. Input a number in binary format in Python
  16. Read input as an integer in Python
  17. Read input as a float in Python
  18. Parse a string to float in Python (float() function)

Python Operators

  1. Python Arithmetic Operators
  2. Python Identity Operators
  3. Python Membership Operators
  4. Behavior of increment and decrement operators in Python
  5. Logical and Bitwise NOT Operators on Boolean in Python
  6. Python Logical Operators on String
  7. Python if else Conditional Operator

Python Conditional Statements

  1. Python Conditional Statements
  2. Python Conditional Statements with break and continue

Python Control Statements

  1. Python Loops
  2. Accessing the index in 'for' loops in Python
  3. Python Looping Constructs
  4. Implement do while loop in Python
  5. Python break Statement
  6. Python continue Statement
  7. Python pass Statement
  8. Python else with for/while statement
  9. Python Replacement for switch Statement

Python Functions

  1. Python Functions: Module's, Built-In, and User-Defined
  2. Different ways to define and call user-defined functions
  3. Function classifications on the basis of parameters and return values
  4. Python Function Calls: Call By Value and Reference
  5. Python Function Parameters: Types and Examples
  6. Python Default Parameters
  7. Python Function as Data Type
  8. Python Lambda Expression/Function
  9. Python Nested Lambda Function
  10. Iterating with Python Lambda
  11. Python map() with Lambda Function
  12. Python filter() with Lambda Function
  13. Python reduce() with Lambda Function
  14. Python - Passing a function as an argument
  15. Python - Returning a function as a return value
  16. Python Currying Function
  17. Python Multiple Function Arguments

Python Strings

  1. Python Strings and Its Implementation
  2. Python String Operators with Examples
  3. Python String Methods (With Examples)
  4. f-strings in Python 3: Formatted string literals
  5. How to print to stderr in Python?
  6. How do you read from stdin in Python?
  7. Best way to convert string to bytes in Python3
  8. What exactly do 'u' and 'r' string flags do, and what are raw string literals in Python?
  9. Python String Comparison

Python Modules

  1. How to check version of Python modules?
  2. Create and Import Modules in Python (with Examples)
  3. Python datetime Module with Examples
  4. Python calendar Module with Examples
  5. Python random Module with Examples
  6. Python sys Module with Examples
  7. Python time Module with Examples
  8. Python pprint (Pretty Printer) Module with Examples
  9. Reloading modules in Python

Python Lists

  1. Python Lists: A Complete Tutorial with Examples
  2. Python List Comprehension
  3. List Methods
  4. Python List Programs
  5. Python List MCQs

Python Object Oriented Concepts

  1. Python Constructors
  2. Python Class/Static Variables
  3. Python Static Methods (with Examples)
  4. Python Metaclasses Tutorial (with Examples)
  5. Python @classmethod Vs. @staticmethod
  6. Python Class & Object Programs

Python Exception Handling

  1. Exceptions handling in Python
  2. User-defined Exception in Python
  3. How to ignore Exceptions in Python?
  4. How do you test that a Python function throws an exception?

Python Libraries and Functions

  1. Shallow Copy Vs Deep Copy in Python
  2. Python Math module methods
  3. Python OS & Shutil Modules Methods

Python Packages

  1. Python Packages | How to create and import them?
  2. How to create Packages (Example of Packages)?

Python Arrays

  1. Signed and Unsigned Integer Arrays in Python
  2. Common Data Items and Methods of an Array in Python
  3. Accessing elements from the array in Python
  4. Adding elements to an array in Python
  5. Convert an array to the list using array.tolist() in Python
  6. Preferred way to retrieve the length of an array in Python
  7. Dask array
    1. Dask Array in Python

Python Numpy

  1. Python NumPy Tutorial
  2. Numpy Array Indexing in Python
  3. Numpy Array Operations in Python

Python Pandas

  1. Python for data analysis – Pandas
  2. Pandas DataFrame in Python (With Examples)
  3. Conditional selection in the DataFrame | Pandas DataFrame
  4. MultiIndex/Multi-level / Advance Indexing dataFrame | Pandas DataFrame
  5. Python Pandas – GroupBy
  6. Python Pandas – Merging, Joining and Concatenating
  7. Python Pandas – Missing Data
  8. Python Pandas – Data Input and Output
  9. Python Pandas Data Operations (With Examples)

Python Dictionary

  1. Python Dictionaries: A Complete Tutorial With Examples
  2. 11 Most Useful Python Dictionary Methods with Examples
  3. OrderedDict in Python (with Examples)
  4. Dictionary Methods
  5. Dictionary Programs

Python Set

  1. Sets in Python
  2. Set Methods

Python Tuples

  1. Tuples in Python
  2. Reverse each tuple in a list of tuples in Python
  3. Creating tuple without using parenthesis in Python
  4. Creating a tuple with one element in Python
  5. Create an empty Python tuple
  6. Clearing a tuple in Python
  7. Reinitializing a tuple in Python
  8. Python Tuple Exercises

Python String Methods

  1. Python String | len() Method with Example
  2. Python String | count() Method with Example
  3. Python String | strip() Method | Remove leading and trailing spaces from string
  4. Python String | strip() Method | Remove leading and trailing characters from string
  5. Python String | isdecimal() Method with Example
  6. Python String | isnumeric() Method with Example
  7. Python String | isdigit() Method with Example
  8. Python | Difference between string isdecimal(), isdigit(), isnumeric() and Methods
  9. Python String | isalnum() and isalpha() Methods with Examples
  10. Python String | isupper() and islower() Methods with Examples
  11. Python String | join() Method with Example
  12. Python String | capitalize() Method with Example
  13. Python String | find() Method with Example
  14. Python String | format() Method with Example
  15. Python | string.upper(), string.lower() and string.title() Methods with Examples
  16. Python String | endswith() method with example
  17. Find all the indexes of all the occurrences of a word in a string in Python
  18. Why is it string.join(list) instead of list.join(string) in Python?
  19. Remove trailing new line in Python
  20. How do I check if a string is a number (float) in Python?
  21. Extracting extension from filename in Python
  22. Random string generation with upper case letters and digits in Python
  23. str() vs repr() functions in Python
  24. Python String formatting: % vs. .format
  25. What does the 'b' character do in front of a string literal in Python?

Python File methods

  1. Python File name Property with Example
  2. Python File mode Property with Example
  3. Python File encoding Property with Example
  4. Python File closed Property with Example
  5. Python File errors Property with Example
  6. Python File open() Method with Example
  7. Python File close() Method with Example
  8. Python File read() Method with Example
  9. Python File write() Method with Example
  10. Python File seek() Method with Example
  11. Python File flush() Method with Example
  12. Python File fileno() Method with Example
  13. Python File readable() Method with Example
  14. Python File writable() Method with Example
  15. Python File seekable() Method with Example
  16. Python File isatty() Method with Example
  17. Python File tell() Method with Example
  18. Python File readline() Method with Example
  19. Python File readlines() Method with Example
  20. Python File writelines() Method with Example
  21. Python File truncate() Method with Example

File handling in python

  1. File Handling in Python
  2. Opening, closing a file/open(), close() functions in Python
  3. Printing file name, closed status and file mode in Python
  4. Writing, Reading content of the file in Python
  5. How to write in an existing file in Python?
  6. Python | Check if a file exists or not?
  7. Python | Example of FileNotFoundError
  8. Python | print the file content along with the filename
  9. Python | Read file from given index (Example of tell() and seek())
  10. Python | Input data from the user, save to the file, read and print
  11. Python | Rename an existing file (Example of os.rename() method)
  12. Python | Remove an existing file (Example of os.remove() method)
  13. Importing files from different folder in Python

Python WebSocket

  1. What is WebSocket and how to use it in Python?
  2. Basic concepts of WebSocket server in Python
  3. How to implement a WebSocket server using Tornado?
  4. Implementation of WebSocket using Socket-IO in Python
  5. Implementation of WebSocket using Flask Socket IO in Python
  6. Websocket keep alive in Python

GUI programming using Python and PyQT

  1. GUI development using Python and PyQT
  2. Print ‘Hello World’ using Python and PyQT (first PyQT program)
  3. Print ‘Hello World’ using Python and PyQT -2 (Theory)
  4. Print ‘Hello World’ using Python and PyQT -2 (Practical)
  5. PyQt Event handling mechanism
  6. Event Handling Examples - PyQt
  7. Event Handling Examples (2)- PyQt
  8. Button Function and Custom Event – PyQt
  9. PyQt- Layout management - 1 (Drag and Drop with QtDesigner)

Python GUI programming using tkinter

  1. GUI programming in Python using tkinter Module
  2. Python | Text Area and Button in Tkinter

Python Image processing

  1. Drawing flag of Thailand | Image processing in Python
  2. Drawing of flag Sweden | Image processing in Python
  3. Drawing flag of Japan | Image processing in Python
  4. Coloured image to grayscale using OpenCV in Python
  5. Find complementary image of the RGB image in Python
  6. Show different planes of an RGB image in Python
  7. Resize a grayscale image without using any inbuilt functions in Python
  8. Resize an RGB image without using any inbuilt functions in Python
  9. Convert an RGB format Image in an HSV format Image using OpenCV in Python
  10. Rotate a grayscale image by 180 degree without using any inbuilt function in Python
  11. Smoothen a grayscale image by performing blurring operation using user defined median blur filter
  12. Smoothen the image by performing blurring operation on a grayscale image using user defined mean blur filter in Python
  13. Upscaling the grayscale image in Python
  14. Upscaling the RGB image in Python
  15. Read an image and save it as grayscale system using OpenCV python module
  16. Edge Detection of Image using OpenCV (CV2) in Python
  17. Cropping an Image using OpenCV in Python
  18. How to Generate and Read QR Code using Python and OpenCV?
  19. Capturing mouse click events with Python and OpenCV
  20. Face and Eye Detection in Python using OpenCV
  21. Create a Collage of Images with the help of NumPy and Python-OpenCV(CV2)

Python Flask

  1. Introduction to Web development using Flask
  2. For loop in Flask template engine

Python Working with Excel

Python Keywords

Python Math module methods

Python OS & Shutil Modules Methods

Python operator Module Methods

Python Topic-wise MCQs

Find output of programs

  1. Find output of Python programs -| Set 1 (Mixed topics)
  2. Find output of Python Programs | Set 1 (Basics)
  3. Find Output of Python programs | Set 2 (Basics)

Python Competitive Coding Questions

  1. Python Arithmetic Sequences | Competitive Coding Questions
  2. Python Power Challenge | Competitive Coding Questions
  3. Python XOR and Arrays | Competitive Coding Questions
  4. All Python competitive coding questions


  1. Matrix implementation in Python
  2. Matrix Multiplication in Python
  3. Descriptors in Python
  4. How to call an external command in Python?
  5. Slice Notation in Python
  6. Understanding slice notation with examples in Python
  7. 5 Best Python Web Scraping Libraries
  8. How do I parse an ISO 8601-formatted date in Python?
  9. What is the quickest way to HTTP GET in Python?
  10. timeit() Function with Example in Python
  11. Optimization using Greedy Algorithm in Python
  12. Python | Linear Algebra
  13. Python | Data Visualization
  14. Perceptron algorithm and its implementation in Python
  15. Scraping Links from a Webpage in Python
  16. Text to speech model in Python
  17. Alarm clock in Python with the help of datetime and pyttsx3
  18. Sending Emails using SMTP in Python
  19. Getting old tweets using Getoldtweets3 module in Python
  20. Automating pdfs in Python
  21. Rock Paper Scissors Game in Python
  22. How to download YouTube videos in Python?
  23. Python | Binary numbers representation (assign, conversion, bitwise operations)
  24. How to install Tkinter in Python?
  25. Generators in Python
  26. List Comprehension vs Generators Expression in Python

Comments and Discussions!

Load comments ↻

Copyright © 2024 All rights reserved.