















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to python programming, covering installation, using the interactive shell, and creating and running python scripts. It explains what python is, its history, key features, and application areas such as data science, machine learning, web development, and game development. The document also includes instructions for installing python on windows, linux, and macos, and discusses python editors and ides.
Typology: Lecture notes
1 / 23
This page cannot be seen from the preview
Don't miss anything!
















Presented by Mohd Shuaib Assistant Professor
Prerequisites: Knowledge of any programming language Reason for increasing popularity:
Java Code public class HelloWorld { public static void main (String[] args) { System.out.println("Hello, world!"); } } Python Code print("Hello, world!")
Install Python on Linux Most of Linux distributions come with Python already installed. However, the Python 2.x version is incorporated in many of them. To check if Python 3.x is available, run the following command in the Linux terminal: $ which python If available, it will return the path to the Python3 executable as /usr/local/bin/python3. To install Python on Ubuntu 18.04, Ubuntu 20.04 and above, execute the following commands: $ sudo apt-get update $ sudo apt-get install python3.7 python3-pip After the installation, you can run Python 3.8 and pip3 commands.
Data Science Python experienced a recent emergence in popularity charts, mainly because of its Data science libraries. A huge amount of data is being generated today by web applications, mobile applications, and other devices. Companies need business insights from this data. Today Python has become the language of choice for data scientists. Python libraries like NumPy, Pandas, and Matplotlib are extensively used in the process of data analysis, including the collection, processing and cleansing of data sets, applying mathematical algorithms, and generating visualizations for the benefit of users. Commercial and community Python distributions by third-parties such as Anaconda and ActiveState provide all the essential libraries required for data science. Machine Learning This is another key application area of Python. Python libraries such as Scikit-learn, Tensorflow and NLTK are widely used for the prediction of trends like customer satisfaction, projected values of stocks, etc. Some of the real-world applications of machine learning include medical diagnosis, statistical arbitrage, basket analysis, sales prediction, etc.
Web Development This is another application area in which Python is becoming popular. Web application framework libraries like django, Pyramid, Flask, etc. make it very easy to develop and deploy simple as well as complex web applications. These frameworks are used extensively by various IT companies. Image Processing The OpenCV library is commonly used for face detection and gesture recognition. OpenCV is a C++ library but has been ported to Python. Because of the rapid development of this feature, Python is a very popular choice from image processing.
Python is an interpreter language. It means it executes the code line by line. Python provides a Python Shell, which is used to execute a single Python command and display the result. It is also known as REPL (Read, Evaluate, Print, Loop), where it reads the command, evaluates the command, prints the result, and loop it back to read the command again. To run the Python Shell, open the command prompt or power shell on Windows and terminal window on mac, write python and press enter. A Python Prompt comprising of three greater-than symbols >>> appears, as shown below.