Professional Documents
Culture Documents
PYTHON
PROGRAMMING
TYPES OF LOOP
Continue…..
DATA STRUCTURE IN PYTHON
It is the way of organizing and storing data so that operations can be performed
efficiently.
Accessing, inserting, deleting, finding, and sorting the data are some of the basic
operations that one can perform using data structures.
def function_name(arguments):
Statement(s)
TYPES OF FUNCTION
• Built-in Functions
• User-defined Functions
• Anonymous Functions
TYPES OF ARGUMENTS
• Required Arguments
• Keyword Arguments
• Default Arguments
• Variable-Length Arguments
MODULE IN PYTHON
Python module can be defined as a python program file which contains a python code
including python functions, class, or variables.
In other words, we can say that our python code file saved with the extension (.py) is
treated as the module.
We may have a runnable code inside the python module.
A module in Python provides us the flexibility to organize the code in a logical way.
To use the functionality of one module into another, we must have to import the specific
module.
Every module has its own functions, those can be accessed with . (dot)
FILE HANDLING IN PYTHON
A file is some information or data which stays in the computer storage devices like music files, video files,
text files.
Python gives us easy ways to manipulate these files.
Python has a built-in function open() to open a file.
Open (‘Path/to/file’, mode)
MODES IN FILE:
There are three modes in which file can be access.
Read or ‘r’
Write or ‘w’
Append or ‘a’
'x’ - Creates a new file. If file already exists, the operation fails.
'a’ - Open file in append mode. If file does not exist, it creates a new file.
't’ - This is the default mode. It opens in text mode.
'b’ - This opens in binary mode.
'+’ - This will open a file for reading and writing (updating)
APPLICATION OF PYTHON LANGUAGE
Python can serve as a scripting language for web applications, e.g., via mod_wsgi for
the Apache web server.
Libraries such as NumPy, SciPy and Matplotlib allow the effective use of Python in
scientific computing, with specialized libraries such as Biopython and Astropy providing
domain-specific functionality.
Python is commonly used in artificial intelligence projects and machine learning projects
with the help of libraries like TensorFlow, Keras, Pytorch and Scikit-learn. As a scripting
language with modular architecture, simple syntax and rich text processing tools, Python
is often used for natural language processing.
Python can also be used to create games, with libraries such as Pygame, which can make
2D games.
Many operating systems include Python as a standard component.
Python is used extensively in the information security industry, including in exploit
development.