Unit 1 (First)
Unit 1 (First)
• Data Science: Data Science is a vast field, and Python is an important language for
this field because of its simplicity, ease of use, and availability of powerful data
analysis and visualization libraries like NumPy, Pandas, and Matplotlib.
• Desktop Applications: PyQt and Tkinter are useful libraries that can be used in GUI
based Desktop Applications.
• Console-based Applications: Python is also commonly used to create command-
line or console-based applications because of its ease of use and support for
advanced features such as input/output redirection and piping.
• Software Development: Python is considered one of the best software-making
languages. Python is easily compatible with both from Small Scale to Large Scale
software.
• Artificial Intelligence: AI is an emerging Technology, and Python is a perfect
language for artificial intelligence and machine learning because of the availability
of powerful libraries such as TensorFlow, Keras, and PyTorch.
• Enterprise Applications: Python can be used to develop large-scale enterprise
applications with features such as distributed computing,networking, and parallel
processing.
• 3D CAD Applications: Python can be used for 3D computer-aided design (CAD)
applications through libraries such as Blender.
• Machine Learning: Python is widely used for machine learning due to its simplicity,
ease of use, and availability of powerful machine learning libraries.
• Computer Vision or Image Processing Applications: Python can be used for
computer vision and image processing applications through powerful libraries such
as OpenCV and Scikit-image.
• Speech Recognition: Python can be used for speech recognition applications
through libraries such as Speech Recognition and PyAudio.
• Scientific computing: Libraries like NumPy, SciPy, and Pandas provide advanced
numerical computing capabilities for tasks like dataanalysis, machine learning, and
more.
• Education: Python's easy-to-learn syntax and availability of many resources make it
an ideal language for teaching programming to beginners.
• Gaming: Python has libraries like Pygame, which provide a platform for developing
games using Python.
• IoT: Python is used in IoT for developing scripts and applications for devices like
Raspberry Pi, Arduino, and others.
• Networking: Python is used in networking for developing scripts and applications
for network automation, monitoring, and management.
• Finance: Python has libraries like Pandas, Scikit-learn, and Statsmodels for financial
modeling and analysis.
• Audio and Music: Python has libraries like Pyaudio, which is used for audio
processing, synthesis, and analysis, and Music21, which isused for music analysis
and generation.
• Writing scripts: Python is used for writing utility scripts to automate tasks like file
operations, web scraping, and data processing.
Features in Python
• Python is a high level language. It is a free and open source
language.
• It is an interpreted language, as Python programs are
executed by an interpreter. The interpreter is also called
Python shell.
• Python programs are easy to understand as they have a
clearly defined syntax and relatively simple structure.
• Python is case-sensitive. For example, NUMBER and
number are not same in Python.
• Python is portable and platform independent, means it can
run on various operating systems and hardware platforms.
• Python has a rich library of predefined functions.
• Python is also helpful in web development. Many popular
web services and applications are builtusing Python.
• Python uses indentation for blocks and nested blocks.
Working with Python
• To write and run (execute) a Python program, we need
to have a Python interpreter installed on our computer
or we can use any online Python interpreter.
• There are two ways to use the Python interpreter:
• a) Interactive mode : Interactive mode allows execution
of individual statement instantly. In the interactive
mode, we cannot save the statements for future use
and we have to retype the statements to run them
again.
• b) Script mode : In the script mode, we can write a
Python program in a file, save it and then use the
interpreter to execute it. Python scripts are saved as
files where file name has extension “.py”. By default,
the Python scripts are saved in the Python installation
folder.
Tokens in Python