SlideShare a Scribd company logo
+
Dr. Ramadan Babers
Faculty of Science - Helwan University
Spring – 2019
Python
LEC - 02
for
Biologists
https://www.linkedin.com/in/ramadan-babers-phd-78976345
+
Introduction
2
Chapter 1 Outlines
 What Is Python?
 General Examples
 Flowcharts Examples (area)
3
1. What Is Python?
4
• Python is a general-purpose
programming language.
• It was designed and developed
to write software for a wide
variety of disciplines.
• Python has been used to write
applications to solve problems in
- biology,
- chemistry,
- financial analysis,
- numerical analysis,
- robotics, and many other fields.
1.1 History
5
• Invented in the Netherlands,early
90s by Guido van Rossum
• Named after Monty Python
• Open sourced from the beginning
• Considered a scripting language,
but is much more
• Scalable, object oriented and
functional from the beginning
• Used by Google from the
beginning
• Increasingly popular
1.2 URLs
6
• Open source general-purpose language.
• Object Oriented, Procedural, Functional
• Great interactive environment
• Downloads: http://www.python.org
• Documentation: http://www.python.org/doc/
• Free book: http://www.diveintopython.org
1.3 ANACONDA NAVIGATOR
7
1.4 Help
8
Python 3.6 Module Docs
+
General Examples
9
1. Flowcharts Examples (area)
10
Example (1)
Calculate the area of a
rectangle, given the length
(L) and width (w).
11
Algorithm:
Step 1 : input first number
Step 2 : input second number
Step 3 : multiply two numbers and
store result in Area
Step 4 : print Area
12
1. Flowcharts Examples (area)
2. Python Examples (user input)
12
+
13
+
Introduction
and
Environment
14
Chapter: 1
15
Why have a programming book for biologists?
A biology-specific programming book allows us to
use examples and exercises that use biological
problems.
This serves two important purposes:
 firstly, it provides motivation and demonstrates the
types of problems that programming can help to
solve.
 Secondly, by using biological examples, the code and
exercises throughout the book can form a library of
useful code snippets, which we can refer back to
when we want to solve real-life problems.
16
Why Python?
The choice of programming language does
matter, of course.To put it another ways, choosing
the "wrong" programming language is very
unlikely to mean the difference between failure
and success when learning.
learning a first programming language gets you
90% of the way towards learning a second, third,
and fourth one. Learning to think like a
programmer in the way that you break down
complex tasks into simple ones is a skill that cuts
across all languages
+
Printing
and
Manipulating Text
17
Chapter: 2
18
Why are we so interested in working with text?
String is the word we use to refer to a bit of text
in a computer program (it just means a string of
characters).
From this point on we'll use the word string
when we're talking about computer code, and
we'll reserve the word sequence for when we're
discussing biological sequences like DNA and
protein.
19
Printing a message to the screen
Name of a function
parentheses
arguments
• The whole line is called a
statement.
• print is the name of a function.
The function tells Python, in
vague terms, what we want to do
– in this case, we want to print
some text. The function name is
alwaysfollowed by parentheses.
• The bits of text inside the
parentheses are called the
arguments to the function.
20
Quotes are important
 strings are always surrounded by quotes.That is how
Python is able to tell the difference between:
o the instructions (like the function name) and
o the data (the thing we want to print).
We can use either
single or double
quotes for strings
21
Quotes are important
 You'll notice that the pervious output doesn't contain
quotes – they are part of the code, not part of the string
itself.
 If we do want to include quotes in the output,
22
Quotes are important - Quiz
 Print the following
“He said”,“Hello Word”
23
Use comments to annotate your code
 Comments are a very useful way to document your
code,You can put the explanation of what a particular
bit of code does right next to the code itself.
24
Error messages and debugging
Forgetting quotes Spelling mistakes
Programming languages are not like
natural languages – they have a very
strict set of rules, and if you break any
of them, the computer will not attempt
to guess what you intended, but
instead will stop running and present
you with an error message.
25
Splitting a statement over two lines
26
 Python got confused
about whether the new
line was
 part of the string
(which is what we wanted) or
 part of the source code
(which is how it was actually
interpreted).
Printing special characters
27
Printing special characters

More Related Content

What's hot

Which One Should You Learn: Java Or Python?
Which One Should You Learn: Java Or Python?Which One Should You Learn: Java Or Python?
Which One Should You Learn: Java Or Python?
D Amies Technologies
 
Chapter 3 what is programming
Chapter 3   what is programmingChapter 3   what is programming
Chapter 3 what is programming
Pro Guide
 
Input, Processing and Output
Input, Processing and OutputInput, Processing and Output
Input, Processing and Output
Munazza-Mah-Jabeen
 
Language translator
Language translatorLanguage translator
Language translator
SumitSumit26
 
STARTING A CAREER IN PROGRAMMING
STARTING A CAREER IN PROGRAMMINGSTARTING A CAREER IN PROGRAMMING
STARTING A CAREER IN PROGRAMMING
ActonRoy
 
Description about python
Description about pythonDescription about python
Description about python
Techdata Solutions
 
Software Project Proposal: Bengali Braille to Text Translation
Software Project Proposal: Bengali Braille to Text TranslationSoftware Project Proposal: Bengali Braille to Text Translation
Software Project Proposal: Bengali Braille to Text Translation
Minhas Kamal
 
Lset's guide for android application development
Lset's guide for android application developmentLset's guide for android application development
Lset's guide for android application development
ActonRoy
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Jaya Kumari
 
Lecture 21 - Preprocessor and Header File
Lecture 21 - Preprocessor and Header FileLecture 21 - Preprocessor and Header File
Lecture 21 - Preprocessor and Header File
Md. Imran Hossain Showrov
 
Career in python
Career in pythonCareer in python
Career in python
SSDN Technologies
 
Abstract- Bengali Braille to Text Translator
Abstract- Bengali Braille to Text TranslatorAbstract- Bengali Braille to Text Translator
Abstract- Bengali Braille to Text Translator
Minhas Kamal
 
Basic introduction to python
Basic introduction to pythonBasic introduction to python
Basic introduction to python
poonam bora
 
Introduction to coding and Python
Introduction to coding and PythonIntroduction to coding and Python
Introduction to coding and Python
Haris NP
 
TRANSLATOR'S TOOLS, by Dr. Shadia Y. BAnjar
TRANSLATOR'S TOOLS, by Dr. Shadia Y. BAnjarTRANSLATOR'S TOOLS, by Dr. Shadia Y. BAnjar
TRANSLATOR'S TOOLS, by Dr. Shadia Y. BAnjar
Dr. Shadia Banjar
 
Adam Goucher I18n And L10n
Adam Goucher   I18n And L10nAdam Goucher   I18n And L10n
Adam Goucher I18n And L10n
Adam Goucher
 
Generations of programming language
Generations of programming languageGenerations of programming language
Generations of programming language
JAIDEVPAUL
 
Programming paradigm and web programming
Programming paradigm and web programmingProgramming paradigm and web programming
Programming paradigm and web programming
Mohammad Kamrul Hasan
 
Machine Learning Techniques in Python Dissertation - Phdassistance
Machine Learning Techniques in Python Dissertation - PhdassistanceMachine Learning Techniques in Python Dissertation - Phdassistance
Machine Learning Techniques in Python Dissertation - Phdassistance
PhD Assistance
 

What's hot (20)

Which One Should You Learn: Java Or Python?
Which One Should You Learn: Java Or Python?Which One Should You Learn: Java Or Python?
Which One Should You Learn: Java Or Python?
 
Chapter 3 what is programming
Chapter 3   what is programmingChapter 3   what is programming
Chapter 3 what is programming
 
Input, Processing and Output
Input, Processing and OutputInput, Processing and Output
Input, Processing and Output
 
Language translator
Language translatorLanguage translator
Language translator
 
STARTING A CAREER IN PROGRAMMING
STARTING A CAREER IN PROGRAMMINGSTARTING A CAREER IN PROGRAMMING
STARTING A CAREER IN PROGRAMMING
 
Description about python
Description about pythonDescription about python
Description about python
 
Software Project Proposal: Bengali Braille to Text Translation
Software Project Proposal: Bengali Braille to Text TranslationSoftware Project Proposal: Bengali Braille to Text Translation
Software Project Proposal: Bengali Braille to Text Translation
 
Lset's guide for android application development
Lset's guide for android application developmentLset's guide for android application development
Lset's guide for android application development
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Lecture 21 - Preprocessor and Header File
Lecture 21 - Preprocessor and Header FileLecture 21 - Preprocessor and Header File
Lecture 21 - Preprocessor and Header File
 
Career in python
Career in pythonCareer in python
Career in python
 
Abstract- Bengali Braille to Text Translator
Abstract- Bengali Braille to Text TranslatorAbstract- Bengali Braille to Text Translator
Abstract- Bengali Braille to Text Translator
 
Basic introduction to python
Basic introduction to pythonBasic introduction to python
Basic introduction to python
 
Introduction to coding and Python
Introduction to coding and PythonIntroduction to coding and Python
Introduction to coding and Python
 
TRANSLATOR'S TOOLS, by Dr. Shadia Y. BAnjar
TRANSLATOR'S TOOLS, by Dr. Shadia Y. BAnjarTRANSLATOR'S TOOLS, by Dr. Shadia Y. BAnjar
TRANSLATOR'S TOOLS, by Dr. Shadia Y. BAnjar
 
Adam Goucher I18n And L10n
Adam Goucher   I18n And L10nAdam Goucher   I18n And L10n
Adam Goucher I18n And L10n
 
Machine Tanslation
Machine TanslationMachine Tanslation
Machine Tanslation
 
Generations of programming language
Generations of programming languageGenerations of programming language
Generations of programming language
 
Programming paradigm and web programming
Programming paradigm and web programmingProgramming paradigm and web programming
Programming paradigm and web programming
 
Machine Learning Techniques in Python Dissertation - Phdassistance
Machine Learning Techniques in Python Dissertation - PhdassistanceMachine Learning Techniques in Python Dissertation - Phdassistance
Machine Learning Techniques in Python Dissertation - Phdassistance
 

Similar to Python lec 1002_for_biologists

Python basics
Python basicsPython basics
Python basics
ssuser4e32df
 
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_Interview_Questions.pdf
Python_Interview_Questions.pdfPython_Interview_Questions.pdf
Python_Interview_Questions.pdf
Samir Paul
 
python-handbook.pdf
python-handbook.pdfpython-handbook.pdf
python-handbook.pdf
RaviKumar76265
 
IRJET- Python: Simple though an Important Programming Language
IRJET- Python: Simple though an Important Programming LanguageIRJET- Python: Simple though an Important Programming Language
IRJET- Python: Simple though an Important Programming Language
IRJET Journal
 
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 Programming Language
Python Programming LanguagePython Programming Language
Python Programming LanguageLaxman Puri
 
Python
PythonPython
python classes in thane
python classes in thanepython classes in thane
python classes in thane
faizrashid1995
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
DrMohammed Qassim
 
MODULE 1.pptx
MODULE 1.pptxMODULE 1.pptx
MODULE 1.pptx
KPDDRAVIDIAN
 
All you need to know about Python | BJIT
All you need to know about Python | BJITAll you need to know about Python | BJIT
All you need to know about Python | BJIT
BJIT Ltd
 
Why Python in required in Civil Engineering
Why Python in required in Civil EngineeringWhy Python in required in Civil Engineering
Why Python in required in Civil Engineering
Rushikesh Kolhe
 
summer t.pdf
summer t.pdfsummer t.pdf
summer t.pdf
RITVIKKAPOOR10
 
python.docx
python.docxpython.docx
python.docx
quess3sagar
 
Python-Mastering-the-Language-of-Data-Science.pptx
Python-Mastering-the-Language-of-Data-Science.pptxPython-Mastering-the-Language-of-Data-Science.pptx
Python-Mastering-the-Language-of-Data-Science.pptx
dmdHaneef
 
Introducing Python Tutorial.pdf
Introducing Python Tutorial.pdfIntroducing Python Tutorial.pdf
Introducing Python Tutorial.pdf
rubaabNaseer
 
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxa9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
cigogag569
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Ranjith kumar
 

Similar to Python lec 1002_for_biologists (20)

Python basics
Python basicsPython basics
Python basics
 
Research paper on python by Rj
Research paper on python by RjResearch paper on python by Rj
Research paper on python by Rj
 
Python_Interview_Questions.pdf
Python_Interview_Questions.pdfPython_Interview_Questions.pdf
Python_Interview_Questions.pdf
 
python-handbook.pdf
python-handbook.pdfpython-handbook.pdf
python-handbook.pdf
 
IRJET- Python: Simple though an Important Programming Language
IRJET- Python: Simple though an Important Programming LanguageIRJET- Python: Simple though an Important Programming Language
IRJET- Python: Simple though an Important Programming Language
 
Python Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docxPython Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docx
 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming Language
 
Python
PythonPython
Python
 
How To Tame Python
How To Tame PythonHow To Tame Python
How To Tame Python
 
python classes in thane
python classes in thanepython classes in thane
python classes in thane
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
MODULE 1.pptx
MODULE 1.pptxMODULE 1.pptx
MODULE 1.pptx
 
All you need to know about Python | BJIT
All you need to know about Python | BJITAll you need to know about Python | BJIT
All you need to know about Python | BJIT
 
Why Python in required in Civil Engineering
Why Python in required in Civil EngineeringWhy Python in required in Civil Engineering
Why Python in required in Civil Engineering
 
summer t.pdf
summer t.pdfsummer t.pdf
summer t.pdf
 
python.docx
python.docxpython.docx
python.docx
 
Python-Mastering-the-Language-of-Data-Science.pptx
Python-Mastering-the-Language-of-Data-Science.pptxPython-Mastering-the-Language-of-Data-Science.pptx
Python-Mastering-the-Language-of-Data-Science.pptx
 
Introducing Python Tutorial.pdf
Introducing Python Tutorial.pdfIntroducing Python Tutorial.pdf
Introducing Python Tutorial.pdf
 
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxa9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 

More from Ramadan Babers, PhD

Part10 finance investment limitations of ratio analysis
Part10 finance investment limitations of ratio analysisPart10 finance investment limitations of ratio analysis
Part10 finance investment limitations of ratio analysis
Ramadan Babers, PhD
 
Part09 finance investment ratio analysis investment ratio
Part09 finance investment ratio analysis investment ratioPart09 finance investment ratio analysis investment ratio
Part09 finance investment ratio analysis investment ratio
Ramadan Babers, PhD
 
Part08 finance investment ratio analysis solvency ratio
Part08 finance investment ratio analysis solvency ratioPart08 finance investment ratio analysis solvency ratio
Part08 finance investment ratio analysis solvency ratio
Ramadan Babers, PhD
 
Part07 finance investment ratio analysis profitability ratio
Part07 finance investment ratio analysis profitability ratioPart07 finance investment ratio analysis profitability ratio
Part07 finance investment ratio analysis profitability ratio
Ramadan Babers, PhD
 
Part06 finance investment ratio analysis efficiency ratio
Part06 finance investment ratio analysis efficiency ratioPart06 finance investment ratio analysis efficiency ratio
Part06 finance investment ratio analysis efficiency ratio
Ramadan Babers, PhD
 
Part05 finance investment_ratio_analysis_liquidity_ratio_presentation
Part05 finance investment_ratio_analysis_liquidity_ratio_presentationPart05 finance investment_ratio_analysis_liquidity_ratio_presentation
Part05 finance investment_ratio_analysis_liquidity_ratio_presentation
Ramadan Babers, PhD
 
Part04 finance investment_ratio_analysis_introduction_presentation
Part04 finance investment_ratio_analysis_introduction_presentationPart04 finance investment_ratio_analysis_introduction_presentation
Part04 finance investment_ratio_analysis_introduction_presentation
Ramadan Babers, PhD
 
Part03 finance investment_financial_statement_analysis_presentation
Part03 finance investment_financial_statement_analysis_presentationPart03 finance investment_financial_statement_analysis_presentation
Part03 finance investment_financial_statement_analysis_presentation
Ramadan Babers, PhD
 
Part02 finance investment_finance_and_financial_reporting_presentation
Part02 finance investment_finance_and_financial_reporting_presentationPart02 finance investment_finance_and_financial_reporting_presentation
Part02 finance investment_finance_and_financial_reporting_presentation
Ramadan Babers, PhD
 
Part01 finance investment_basics_presentation
Part01 finance investment_basics_presentationPart01 finance investment_basics_presentation
Part01 finance investment_basics_presentation
Ramadan Babers, PhD
 
Strategic Management part_03_03
Strategic Management part_03_03Strategic Management part_03_03
Strategic Management part_03_03
Ramadan Babers, PhD
 
Strategic Management part_02_03
Strategic Management part_02_03Strategic Management part_02_03
Strategic Management part_02_03
Ramadan Babers, PhD
 
Strategic Management part_01_03
Strategic Management part_01_03Strategic Management part_01_03
Strategic Management part_01_03
Ramadan Babers, PhD
 
Customer Experience (CX) updated version V9.0
Customer Experience (CX) updated version V9.0Customer Experience (CX) updated version V9.0
Customer Experience (CX) updated version V9.0
Ramadan Babers, PhD
 
Classification using decision tree in detail
Classification using decision tree in detailClassification using decision tree in detail
Classification using decision tree in detail
Ramadan Babers, PhD
 
Customer Experience (CX)
Customer Experience (CX)Customer Experience (CX)
Customer Experience (CX)
Ramadan Babers, PhD
 
Python lec 1004_ch02_excercies
Python lec 1004_ch02_excerciesPython lec 1004_ch02_excercies
Python lec 1004_ch02_excercies
Ramadan Babers, PhD
 
Python lec 1003_for_biologists
Python lec 1003_for_biologistsPython lec 1003_for_biologists
Python lec 1003_for_biologists
Ramadan Babers, PhD
 
Db lec 08_new
Db lec 08_newDb lec 08_new
Db lec 08_new
Ramadan Babers, PhD
 
Db lec 07_new
Db lec 07_newDb lec 07_new
Db lec 07_new
Ramadan Babers, PhD
 

More from Ramadan Babers, PhD (20)

Part10 finance investment limitations of ratio analysis
Part10 finance investment limitations of ratio analysisPart10 finance investment limitations of ratio analysis
Part10 finance investment limitations of ratio analysis
 
Part09 finance investment ratio analysis investment ratio
Part09 finance investment ratio analysis investment ratioPart09 finance investment ratio analysis investment ratio
Part09 finance investment ratio analysis investment ratio
 
Part08 finance investment ratio analysis solvency ratio
Part08 finance investment ratio analysis solvency ratioPart08 finance investment ratio analysis solvency ratio
Part08 finance investment ratio analysis solvency ratio
 
Part07 finance investment ratio analysis profitability ratio
Part07 finance investment ratio analysis profitability ratioPart07 finance investment ratio analysis profitability ratio
Part07 finance investment ratio analysis profitability ratio
 
Part06 finance investment ratio analysis efficiency ratio
Part06 finance investment ratio analysis efficiency ratioPart06 finance investment ratio analysis efficiency ratio
Part06 finance investment ratio analysis efficiency ratio
 
Part05 finance investment_ratio_analysis_liquidity_ratio_presentation
Part05 finance investment_ratio_analysis_liquidity_ratio_presentationPart05 finance investment_ratio_analysis_liquidity_ratio_presentation
Part05 finance investment_ratio_analysis_liquidity_ratio_presentation
 
Part04 finance investment_ratio_analysis_introduction_presentation
Part04 finance investment_ratio_analysis_introduction_presentationPart04 finance investment_ratio_analysis_introduction_presentation
Part04 finance investment_ratio_analysis_introduction_presentation
 
Part03 finance investment_financial_statement_analysis_presentation
Part03 finance investment_financial_statement_analysis_presentationPart03 finance investment_financial_statement_analysis_presentation
Part03 finance investment_financial_statement_analysis_presentation
 
Part02 finance investment_finance_and_financial_reporting_presentation
Part02 finance investment_finance_and_financial_reporting_presentationPart02 finance investment_finance_and_financial_reporting_presentation
Part02 finance investment_finance_and_financial_reporting_presentation
 
Part01 finance investment_basics_presentation
Part01 finance investment_basics_presentationPart01 finance investment_basics_presentation
Part01 finance investment_basics_presentation
 
Strategic Management part_03_03
Strategic Management part_03_03Strategic Management part_03_03
Strategic Management part_03_03
 
Strategic Management part_02_03
Strategic Management part_02_03Strategic Management part_02_03
Strategic Management part_02_03
 
Strategic Management part_01_03
Strategic Management part_01_03Strategic Management part_01_03
Strategic Management part_01_03
 
Customer Experience (CX) updated version V9.0
Customer Experience (CX) updated version V9.0Customer Experience (CX) updated version V9.0
Customer Experience (CX) updated version V9.0
 
Classification using decision tree in detail
Classification using decision tree in detailClassification using decision tree in detail
Classification using decision tree in detail
 
Customer Experience (CX)
Customer Experience (CX)Customer Experience (CX)
Customer Experience (CX)
 
Python lec 1004_ch02_excercies
Python lec 1004_ch02_excerciesPython lec 1004_ch02_excercies
Python lec 1004_ch02_excercies
 
Python lec 1003_for_biologists
Python lec 1003_for_biologistsPython lec 1003_for_biologists
Python lec 1003_for_biologists
 
Db lec 08_new
Db lec 08_newDb lec 08_new
Db lec 08_new
 
Db lec 07_new
Db lec 07_newDb lec 07_new
Db lec 07_new
 

Recently uploaded

Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 

Recently uploaded (20)

Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 

Python lec 1002_for_biologists

  • 1. + Dr. Ramadan Babers Faculty of Science - Helwan University Spring – 2019 Python LEC - 02 for Biologists https://www.linkedin.com/in/ramadan-babers-phd-78976345
  • 3. Chapter 1 Outlines  What Is Python?  General Examples  Flowcharts Examples (area) 3
  • 4. 1. What Is Python? 4 • Python is a general-purpose programming language. • It was designed and developed to write software for a wide variety of disciplines. • Python has been used to write applications to solve problems in - biology, - chemistry, - financial analysis, - numerical analysis, - robotics, and many other fields.
  • 5. 1.1 History 5 • Invented in the Netherlands,early 90s by Guido van Rossum • Named after Monty Python • Open sourced from the beginning • Considered a scripting language, but is much more • Scalable, object oriented and functional from the beginning • Used by Google from the beginning • Increasingly popular
  • 6. 1.2 URLs 6 • Open source general-purpose language. • Object Oriented, Procedural, Functional • Great interactive environment • Downloads: http://www.python.org • Documentation: http://www.python.org/doc/ • Free book: http://www.diveintopython.org
  • 8. 1.4 Help 8 Python 3.6 Module Docs
  • 10. 1. Flowcharts Examples (area) 10 Example (1) Calculate the area of a rectangle, given the length (L) and width (w).
  • 11. 11 Algorithm: Step 1 : input first number Step 2 : input second number Step 3 : multiply two numbers and store result in Area Step 4 : print Area 12 1. Flowcharts Examples (area)
  • 12. 2. Python Examples (user input) 12
  • 13. + 13
  • 15. 15 Why have a programming book for biologists? A biology-specific programming book allows us to use examples and exercises that use biological problems. This serves two important purposes:  firstly, it provides motivation and demonstrates the types of problems that programming can help to solve.  Secondly, by using biological examples, the code and exercises throughout the book can form a library of useful code snippets, which we can refer back to when we want to solve real-life problems.
  • 16. 16 Why Python? The choice of programming language does matter, of course.To put it another ways, choosing the "wrong" programming language is very unlikely to mean the difference between failure and success when learning. learning a first programming language gets you 90% of the way towards learning a second, third, and fourth one. Learning to think like a programmer in the way that you break down complex tasks into simple ones is a skill that cuts across all languages
  • 18. 18 Why are we so interested in working with text? String is the word we use to refer to a bit of text in a computer program (it just means a string of characters). From this point on we'll use the word string when we're talking about computer code, and we'll reserve the word sequence for when we're discussing biological sequences like DNA and protein.
  • 19. 19 Printing a message to the screen Name of a function parentheses arguments • The whole line is called a statement. • print is the name of a function. The function tells Python, in vague terms, what we want to do – in this case, we want to print some text. The function name is alwaysfollowed by parentheses. • The bits of text inside the parentheses are called the arguments to the function.
  • 20. 20 Quotes are important  strings are always surrounded by quotes.That is how Python is able to tell the difference between: o the instructions (like the function name) and o the data (the thing we want to print). We can use either single or double quotes for strings
  • 21. 21 Quotes are important  You'll notice that the pervious output doesn't contain quotes – they are part of the code, not part of the string itself.  If we do want to include quotes in the output,
  • 22. 22 Quotes are important - Quiz  Print the following “He said”,“Hello Word”
  • 23. 23 Use comments to annotate your code  Comments are a very useful way to document your code,You can put the explanation of what a particular bit of code does right next to the code itself.
  • 24. 24 Error messages and debugging Forgetting quotes Spelling mistakes Programming languages are not like natural languages – they have a very strict set of rules, and if you break any of them, the computer will not attempt to guess what you intended, but instead will stop running and present you with an error message.
  • 25. 25 Splitting a statement over two lines
  • 26. 26  Python got confused about whether the new line was  part of the string (which is what we wanted) or  part of the source code (which is how it was actually interpreted). Printing special characters