Chapter 1 - Introduction To Python
Chapter 1 - Introduction To Python
Chapter 1 - Introduction To Python
Jamil Saudagar
Jamil Saudagar 1 of 75
Introduction and History
• Python was developed by Guido Van Rossum in the year 1991 at the Center for Mathematics and Computer
Science
• The name Python was picked up from a T.V. show Monty Python’s Flying Circus.
• The first working version was ready by early 1990 and was released for the public on 20th February 1991.
• It is an open source software. It combines the functionality of C with object oriented approach of Java
• Features of Python
• Simple and Easy to learn
• Dynamically Typed i.e. An assignment statement binds a name to an object
• Platform independent
• Huge Library
• Does not use a compiler but uses an interpreter to execute instructions
Jamil Saudagar 2 of 75
Introduction and History
• Execution of a Python program
Compile PVM
Jamil Saudagar 3 of 75
Introduction and History
Jamil Saudagar 4 of 75
Python Installation
• Open your Browser and go to https://www.python.org/downloads/
• Once the installation file is downloaded; click on the executable file and select appropriate options at the
Python installation prompt. When in doubt; select the default choice.
• Remember to add python.exe to the default path. This way python can run from any of the folders.
Jamil Saudagar 5 of 75
Different methods to start a Python session
• Windows Start > Python > Python 3.7 (64-bit)
Jamil Saudagar 6 of 75
Different methods to start a Python session
• Windows Start > Anaconda3 > Anaconda Navigator
• Windows Start > Anaconda3 > Anaconda Prompt (We are going to use this method)
Jamil Saudagar 7 of 75
Getting Started
• The coding environment
• Click on the Anaconda prompt to open a command window
• Navigate to the project folder where you would like to save the code files.
Jamil Saudagar 8 of 75
Getting Started
• Click on New > Python3 to start a new session (Please remember Python is a case sensitive language)
• Type help() at the prompt to get into help mode, pressing enter at the help prompt will help us exit the help
window
Jamil Saudagar 9 of 75
Getting Started
• Input and Output using the print() and input() statements
• print('Hello World !!!')
• print("He isn't in the best of his moods")
• print("The sum of 2 and 5 is = ", 2+5)
•
Jamil Saudagar 10 of 75
Getting Started
• The input() statement
• Keyboard Shortcuts
• Press <Esc + H> to get a list of shortcuts
• Markdowns
• Markdowns help us add a title (heading) to our cell(s). We can create headings from H1 to H6
Jamil Saudagar 11 of 75