Assignment 1 Task 2
Assignment 1 Task 2
TO PYTHON
History, Functions And Modules
High-level, interpreted programming language.
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.
Cross-platform compatibility.
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