INTRODUCTION
TO PYTHON
History, Functions And Modules
High-level, interpreted programming language.
Created by Guido van Rossum.
First released in 1991.
Emphasizes code readability with simple
syntax.
Widely used in web development, data science,
automation, and more.
WHAT IS PYTHON?
Developed as a successor to the ABC
programming language.
Name “Python” inspired by Monty Python’s
Flying Circus.
Open-sourced from the beginning.
Major versions: Python 2 (2000), Python 3
(2008).
Python 3 is the current and actively developed
version.
HISTORY OF PYTHON
Easy to read and write.
Large standard library.
Massive community support.
Cross-platform compatibility.
WHY LEARN PYTHON?
A function is a block of reusable code.
Defined using the ‘def’ keyword.
Can accept parameters and return values.
Improves modularity and reusability.
FUNCTIONS IN PYTHON
Functions Built-in Functions:
print(), len(), type()
User-defined
Functions: Created
by the programmer
Lambda Functions:
Anonymous
functions using
lambda keyword
TYPES OF FUNCTIONS
A module is a file containing Python definitions
and statements.
Helps organize large programs into small files.
Can be imported into other scripts.
MODULES IN PYTHON
Commonly Used Modules :
math: Mathematical functions
Datetime: Date and time handling
random: Generate random numbers
OS: Interact with the operating system
Creating a Custom Module :
Create a .py file with
functions.
Import it in another
script.
Python is beginner-friendly and powerful.
Functions help organize and reuse code.
Modules make code modular and manageable.
Knowing how to use both is key for efficient
programming.
CONCLUSION