SlideShare a Scribd company logo
Course No.: 803427-3
By
Dr. Tamer Ahmed Farrag
Introduction to Python
2
Why Python?
 Free
 Easy to learn
 Easy communication
 Efficient code
 Universal
 Rich collection of numerical
methods, plotting or data
processing tools.
3
Python Language
Python, a generic and modern computing language:
• The language: flow control, data types (string, int), data collections (lists,
dictionaries), etc.
• Modules of the standard library: string processing, file management,
simple network protocols.
• A large number of specialized modules or applications written in Python:
web framework, etc. … and scientific computing.
• Development tools (automatic testing, documentation generation)
Unlike Matlab, or R, Python does not come with a pre-bundled set
of modules for scientific computing.
4
Most important Add-on libraries
5
Installing Python
There is two ways to Start working with python:
1- download and install the python language interpreter from the official
web site :
https://www.python.org/
Then start to install the required libraries one by one.
2- install a scientific-computing distribution, that comes readily with
optimized versions of scientific modules. For Example:
- Anaconda (recommended) - EPD - WinPython
Download Anaconda from : https://www.anaconda.com/download/ choose your
Operating system and python 3.7
6
ANACONDA distribution overview
7
interactive environments and
text editors
There is many methods to start programming using python includes:
1- Using Command window
3- Using Interactive environments
2- Using Text Editors and IDEs
 Using Command window:
• Open anaconda prompt
• Type Python ⏎
(The python command windows is start working)
8
interactive environments and
text editors (cont.)
 Using Interactive environments (my recommend method during learning)
 an interactive work with the IPython console from anaconda prompt, or its
offspring, the Jupyter notebook from Anaconda Navigator.
 Start Anaconda Navigator
 Launch Jupyter notebook and start working
See also
• IPython user manual: http://ipython.org/ipython-doc/dev/index.html
• Jupyter Notebook QuickStart: http://jupyter.readthedocs.io/en/latest/content-quickstart.html
9
interactive environments and
text editors (cont.)
 Using Text editors and IDEs
 Tens IDEs are available for python but the best of them includes:
• Microsoft Visual Studio
• Pycharm IDE
• Pydev IDE
• Vim
• Atom
• Netbeans
See also
https://www.visualstudio.com/vs/python/
10
Python Language
Python is a programming language, as are C, Fortran, BASIC, PHP, etc.
Some specific features of Python are as follows:
• an interpreted (as opposed to compiled) language. Python can be
used interactively.
• a free software released under an open-source license: Python can be
used and distributed free of charge, even for building commercial
software.
• multi-platform: Python is available for all major operating systems.
• a very readable language with clear non-verbose syntax
• a language for which a large variety of high-quality packages are
available for various applications, from web frameworks to scientific
computing.
• a language very easy to interface with other languages, in particular C
and C++.
• Some other features of the language are illustrated just below. For
example, Python is an object-oriented language, with dynamic typing
(the same variable can contain objects of different types during the
course of a program).
11
Python Basics
• Command Line Window
The >>> is called a prompt. This is where python waits for instructions.
It is like an ear constantly waiting for orders to be executed. Entering an
instruction means typing it at the command line prompt and
pressing return.
>>>
>> x = 9 # assign the value 9 to x
12
Python Variables
 A variable is a name that refers to a value.
 In Python, No need to declare variables
 An assignment statement creates new variables and gives them values.
13
Python Variables (cont.)
 Programmers generally choose names for their variables that are
meaningful and document what the variable is used for.
 Variable names can be arbitrarily long.
 They can contain both letters and numbers, but they cannot start with a
number.
 They can contain underscore character (_).
 If you give a variable an illegal name, you get a syntax error.
 Python's keywords cannot be used as variable names.
Python reserves 33 keywords:
14
Python Operators Precedence
15
Python Operators Example
16
Asking the user for input
 Python provides a built-in function called input that gets input from the
keyboard.
 When this function is called, the program stops and waits for the user to
type something.
 When the user presses Return or Enter, the program resumes and input
returns what the user typed as a string.
17
Comments
 Comments in Python start with the hash character, #, and extend to the
end of the physical line.
 A comment may appear at the start of a line or following whitespace or
code, but not within a string literal.
 A hash character within a string literal is just a hash character.
 Comments are to clarify code and are not interpreted by Python, they may
be omitted when typing in examples.
18
Resources
 Scipy Lecture Notes
http://www.scipy-lectures.org/
 Python for Everybody
https://www.py4e.com/
 Python official documentation
https://docs.python.org
 Anaconda web site
https://www.anaconda.com
Ad

More Related Content

What's hot (20)

Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of python
BijuAugustian
 
Python quick guide1
Python quick guide1Python quick guide1
Python quick guide1
Kanchilug
 
Introduction to python
 Introduction to python Introduction to python
Introduction to python
Learnbay Datascience
 
Python course syllabus
Python course syllabusPython course syllabus
Python course syllabus
Sugantha T
 
Python
PythonPython
Python
Learnbay Datascience
 
Introduction to Python Basics Programming
Introduction to Python Basics ProgrammingIntroduction to Python Basics Programming
Introduction to Python Basics Programming
Collaboration Technologies
 
Programming
ProgrammingProgramming
Programming
monishagoyal4
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Jaya Kumari
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
eShikshak
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
Sujith Kumar
 
Introduction python
Introduction pythonIntroduction python
Introduction python
Jumbo Techno e_Learning
 
11 Unit1 Chapter 1 Getting Started With Python
11   Unit1 Chapter 1 Getting Started With Python11   Unit1 Chapter 1 Getting Started With Python
11 Unit1 Chapter 1 Getting Started With Python
Praveen M Jigajinni
 
introduction of python in data science
introduction of python in data scienceintroduction of python in data science
introduction of python in data science
bhavesh lande
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
primeteacher32
 
summer training report on python
summer training report on pythonsummer training report on python
summer training report on python
Shubham Yadav
 
Cmpe202 01 Research
Cmpe202 01 ResearchCmpe202 01 Research
Cmpe202 01 Research
vladimirkorshak
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
DrMohammed Qassim
 
Seminar report on python 3 course
Seminar report on python 3 courseSeminar report on python 3 course
Seminar report on python 3 course
HimanshuPanwar38
 
Getting Started with Python
Getting Started with PythonGetting Started with Python
Getting Started with Python
Sankhya_Analytics
 
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of python
BijuAugustian
 
Python quick guide1
Python quick guide1Python quick guide1
Python quick guide1
Kanchilug
 
Python course syllabus
Python course syllabusPython course syllabus
Python course syllabus
Sugantha T
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Jaya Kumari
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
eShikshak
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
Sujith Kumar
 
11 Unit1 Chapter 1 Getting Started With Python
11   Unit1 Chapter 1 Getting Started With Python11   Unit1 Chapter 1 Getting Started With Python
11 Unit1 Chapter 1 Getting Started With Python
Praveen M Jigajinni
 
introduction of python in data science
introduction of python in data scienceintroduction of python in data science
introduction of python in data science
bhavesh lande
 
summer training report on python
summer training report on pythonsummer training report on python
summer training report on python
Shubham Yadav
 
Seminar report on python 3 course
Seminar report on python 3 courseSeminar report on python 3 course
Seminar report on python 3 course
HimanshuPanwar38
 
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
Bhavsingh Maloth
 

Similar to 01 python introduction (20)

Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdf
VaibhavKumarSinghkal
 
Python Programming Note for only beginers
Python Programming Note for only beginersPython Programming Note for only beginers
Python Programming Note for only beginers
sifatullah42
 
python-handbook.pdf
python-handbook.pdfpython-handbook.pdf
python-handbook.pdf
RaviKumar76265
 
Session-1_Introduction to Python.pptx
Session-1_Introduction to Python.pptxSession-1_Introduction to Python.pptx
Session-1_Introduction to Python.pptx
WajidAliHashmi2
 
Introduction-to-Python-Programming1.pptx
Introduction-to-Python-Programming1.pptxIntroduction-to-Python-Programming1.pptx
Introduction-to-Python-Programming1.pptx
vijayalakshmi257551
 
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxa9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
cigogag569
 
Chapter - 1.pptx
Chapter - 1.pptxChapter - 1.pptx
Chapter - 1.pptx
MikialeTesfamariam
 
Python Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docxPython Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docx
Manohar k
 
Research paper on python by Rj
Research paper on python by RjResearch paper on python by Rj
Research paper on python by Rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
Python Programming Part 1.pdf
Python Programming Part 1.pdfPython Programming Part 1.pdf
Python Programming Part 1.pdf
percivalfernandez2
 
Python Programming Part 1.pdf
Python Programming Part 1.pdfPython Programming Part 1.pdf
Python Programming Part 1.pdf
percivalfernandez2
 
Python Programming Part 1.pdf
Python Programming Part 1.pdfPython Programming Part 1.pdf
Python Programming Part 1.pdf
percivalfernandez2
 
MODULE 1.pptx
MODULE 1.pptxMODULE 1.pptx
MODULE 1.pptx
KPDDRAVIDIAN
 
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Niraj Bharambe
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
Ramakrishna Reddy Bijjam
 
Python Programmimg language in Gurugram
Python  Programmimg language in GurugramPython  Programmimg language in Gurugram
Python Programmimg language in Gurugram
digitallynikitasharm
 
Python programming
Python programmingPython programming
Python programming
Prof. Dr. K. Adisesha
 
Web Programming UNIT VIII notes
Web Programming UNIT VIII notesWeb Programming UNIT VIII notes
Web Programming UNIT VIII notes
Bhavsingh Maloth
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
MohammadSamiuddin10
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
MohammadSamiuddin10
 
Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdf
VaibhavKumarSinghkal
 
Python Programming Note for only beginers
Python Programming Note for only beginersPython Programming Note for only beginers
Python Programming Note for only beginers
sifatullah42
 
Session-1_Introduction to Python.pptx
Session-1_Introduction to Python.pptxSession-1_Introduction to Python.pptx
Session-1_Introduction to Python.pptx
WajidAliHashmi2
 
Introduction-to-Python-Programming1.pptx
Introduction-to-Python-Programming1.pptxIntroduction-to-Python-Programming1.pptx
Introduction-to-Python-Programming1.pptx
vijayalakshmi257551
 
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxa9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
cigogag569
 
Python Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docxPython Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docx
Manohar k
 
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Niraj Bharambe
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
Ramakrishna Reddy Bijjam
 
Python Programmimg language in Gurugram
Python  Programmimg language in GurugramPython  Programmimg language in Gurugram
Python Programmimg language in Gurugram
digitallynikitasharm
 
Web Programming UNIT VIII notes
Web Programming UNIT VIII notesWeb Programming UNIT VIII notes
Web Programming UNIT VIII notes
Bhavsingh Maloth
 
Ad

Recently uploaded (20)

How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
Lionel Briand
 
Creating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdfCreating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdf
Applitools
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Best Practices for Collaborating with 3D Artists in Mobile Game Development
Best Practices for Collaborating with 3D Artists in Mobile Game DevelopmentBest Practices for Collaborating with 3D Artists in Mobile Game Development
Best Practices for Collaborating with 3D Artists in Mobile Game Development
Juego Studios
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
DVDFab Crack FREE Download Latest Version 2025
DVDFab Crack FREE Download Latest Version 2025DVDFab Crack FREE Download Latest Version 2025
DVDFab Crack FREE Download Latest Version 2025
younisnoman75
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Cryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptxCryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptx
riyageorge2024
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Innovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at allInnovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at all
ayeshakanwal75
 
Microsoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptxMicrosoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptx
Mekonnen
 
Odoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education ProcessOdoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education Process
iVenture Team LLP
 
How to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud PerformanceHow to Optimize Your AWS Environment for Improved Cloud Performance
How to Optimize Your AWS Environment for Improved Cloud Performance
ThousandEyes
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
Lionel Briand
 
Creating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdfCreating Automated Tests with AI - Cory House - Applitools.pdf
Creating Automated Tests with AI - Cory House - Applitools.pdf
Applitools
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Best Practices for Collaborating with 3D Artists in Mobile Game Development
Best Practices for Collaborating with 3D Artists in Mobile Game DevelopmentBest Practices for Collaborating with 3D Artists in Mobile Game Development
Best Practices for Collaborating with 3D Artists in Mobile Game Development
Juego Studios
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
DVDFab Crack FREE Download Latest Version 2025
DVDFab Crack FREE Download Latest Version 2025DVDFab Crack FREE Download Latest Version 2025
DVDFab Crack FREE Download Latest Version 2025
younisnoman75
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Cryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptxCryptocurrency Exchange Script like Binance.pptx
Cryptocurrency Exchange Script like Binance.pptx
riyageorge2024
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Innovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at allInnovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at all
ayeshakanwal75
 
Microsoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptxMicrosoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptx
Mekonnen
 
Odoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education ProcessOdoo ERP for Education Management to Streamline Your Education Process
Odoo ERP for Education Management to Streamline Your Education Process
iVenture Team LLP
 
Ad

01 python introduction

  • 1. Course No.: 803427-3 By Dr. Tamer Ahmed Farrag Introduction to Python
  • 2. 2 Why Python?  Free  Easy to learn  Easy communication  Efficient code  Universal  Rich collection of numerical methods, plotting or data processing tools.
  • 3. 3 Python Language Python, a generic and modern computing language: • The language: flow control, data types (string, int), data collections (lists, dictionaries), etc. • Modules of the standard library: string processing, file management, simple network protocols. • A large number of specialized modules or applications written in Python: web framework, etc. … and scientific computing. • Development tools (automatic testing, documentation generation) Unlike Matlab, or R, Python does not come with a pre-bundled set of modules for scientific computing.
  • 5. 5 Installing Python There is two ways to Start working with python: 1- download and install the python language interpreter from the official web site : https://www.python.org/ Then start to install the required libraries one by one. 2- install a scientific-computing distribution, that comes readily with optimized versions of scientific modules. For Example: - Anaconda (recommended) - EPD - WinPython Download Anaconda from : https://www.anaconda.com/download/ choose your Operating system and python 3.7
  • 7. 7 interactive environments and text editors There is many methods to start programming using python includes: 1- Using Command window 3- Using Interactive environments 2- Using Text Editors and IDEs  Using Command window: • Open anaconda prompt • Type Python ⏎ (The python command windows is start working)
  • 8. 8 interactive environments and text editors (cont.)  Using Interactive environments (my recommend method during learning)  an interactive work with the IPython console from anaconda prompt, or its offspring, the Jupyter notebook from Anaconda Navigator.  Start Anaconda Navigator  Launch Jupyter notebook and start working See also • IPython user manual: http://ipython.org/ipython-doc/dev/index.html • Jupyter Notebook QuickStart: http://jupyter.readthedocs.io/en/latest/content-quickstart.html
  • 9. 9 interactive environments and text editors (cont.)  Using Text editors and IDEs  Tens IDEs are available for python but the best of them includes: • Microsoft Visual Studio • Pycharm IDE • Pydev IDE • Vim • Atom • Netbeans See also https://www.visualstudio.com/vs/python/
  • 10. 10 Python Language Python is a programming language, as are C, Fortran, BASIC, PHP, etc. Some specific features of Python are as follows: • an interpreted (as opposed to compiled) language. Python can be used interactively. • a free software released under an open-source license: Python can be used and distributed free of charge, even for building commercial software. • multi-platform: Python is available for all major operating systems. • a very readable language with clear non-verbose syntax • a language for which a large variety of high-quality packages are available for various applications, from web frameworks to scientific computing. • a language very easy to interface with other languages, in particular C and C++. • Some other features of the language are illustrated just below. For example, Python is an object-oriented language, with dynamic typing (the same variable can contain objects of different types during the course of a program).
  • 11. 11 Python Basics • Command Line Window The >>> is called a prompt. This is where python waits for instructions. It is like an ear constantly waiting for orders to be executed. Entering an instruction means typing it at the command line prompt and pressing return. >>> >> x = 9 # assign the value 9 to x
  • 12. 12 Python Variables  A variable is a name that refers to a value.  In Python, No need to declare variables  An assignment statement creates new variables and gives them values.
  • 13. 13 Python Variables (cont.)  Programmers generally choose names for their variables that are meaningful and document what the variable is used for.  Variable names can be arbitrarily long.  They can contain both letters and numbers, but they cannot start with a number.  They can contain underscore character (_).  If you give a variable an illegal name, you get a syntax error.  Python's keywords cannot be used as variable names. Python reserves 33 keywords:
  • 16. 16 Asking the user for input  Python provides a built-in function called input that gets input from the keyboard.  When this function is called, the program stops and waits for the user to type something.  When the user presses Return or Enter, the program resumes and input returns what the user typed as a string.
  • 17. 17 Comments  Comments in Python start with the hash character, #, and extend to the end of the physical line.  A comment may appear at the start of a line or following whitespace or code, but not within a string literal.  A hash character within a string literal is just a hash character.  Comments are to clarify code and are not interpreted by Python, they may be omitted when typing in examples.
  • 18. 18 Resources  Scipy Lecture Notes http://www.scipy-lectures.org/  Python for Everybody https://www.py4e.com/  Python official documentation https://docs.python.org  Anaconda web site https://www.anaconda.com