SlideShare a Scribd company logo
1 of 27
Download to read offline
+
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 programmingPro Guide
 
Language translator
Language translatorLanguage translator
Language translatorSumitSumit26
 
STARTING A CAREER IN PROGRAMMING
STARTING A CAREER IN PROGRAMMINGSTARTING A CAREER IN PROGRAMMING
STARTING A CAREER IN PROGRAMMINGActonRoy
 
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 TranslationMinhas 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 developmentActonRoy
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonJaya Kumari
 
Abstract- Bengali Braille to Text Translator
Abstract- Bengali Braille to Text TranslatorAbstract- Bengali Braille to Text Translator
Abstract- Bengali Braille to Text TranslatorMinhas Kamal
 
Basic introduction to python
Basic introduction to pythonBasic introduction to python
Basic introduction to pythonpoonam bora
 
Introduction to coding and Python
Introduction to coding and PythonIntroduction to coding and Python
Introduction to coding and PythonHaris 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. BAnjarDr. Shadia Banjar
 
Adam Goucher I18n And L10n
Adam Goucher   I18n And L10nAdam Goucher   I18n And L10n
Adam Goucher I18n And L10nAdam Goucher
 
Generations of programming language
Generations of programming languageGenerations of programming language
Generations of programming languageJAIDEVPAUL
 
Programming paradigm and web programming
Programming paradigm and web programmingProgramming paradigm and web programming
Programming paradigm and web programmingMohammad 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 - PhdassistancePhD 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

What is Python.pptx
What is Python.pptxWhat is Python.pptx
What is Python.pptxMalluKomar
 
Python_Interview_Questions.pdf
Python_Interview_Questions.pdfPython_Interview_Questions.pdf
Python_Interview_Questions.pdfSamir Paul
 
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 LanguageIRJET Journal
 
Python Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docxPython Programming and ApplicationsUnit-1.docx
Python Programming and ApplicationsUnit-1.docxManohar k
 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming LanguageLaxman Puri
 
python classes in thane
python classes in thanepython classes in thane
python classes in thanefaizrashid1995
 
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 | BJITBJIT 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 EngineeringRushikesh Kolhe
 
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.pptxdmdHaneef
 
Introducing Python Tutorial.pdf
Introducing Python Tutorial.pdfIntroducing Python Tutorial.pdf
Introducing Python Tutorial.pdfrubaabNaseer
 
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxa9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxcigogag569
 

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
 
What is Python.pptx
What is Python.pptxWhat is Python.pptx
What is Python.pptx
 
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
 

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 analysisRamadan 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 ratioRamadan 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 ratioRamadan 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 ratioRamadan 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 ratioRamadan 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_presentationRamadan 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_presentationRamadan 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_presentationRamadan 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_presentationRamadan Babers, PhD
 
Part01 finance investment_basics_presentation
Part01 finance investment_basics_presentationPart01 finance investment_basics_presentation
Part01 finance investment_basics_presentationRamadan 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.0Ramadan Babers, PhD
 
Classification using decision tree in detail
Classification using decision tree in detailClassification using decision tree in detail
Classification using decision tree in detailRamadan 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

Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 

Recently uploaded (20)

Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 

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