SlideShare a Scribd company logo
Python Essentials
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Intro
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Introduction
• The fundamentals of computer programming
• Setting up your programming environment
• Compilation vs. interpretation
• Introduction to Python
Module 1
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Data types and the basic methods of formatting, converting, inputting and
outputting data;
• Literals
• Integers, floats, strings, Boolean, octal, hexadecimal
• Operators
• + (addition), - (subtraction), * (multiplication), / (classic division), % (modulus),
** (exponentiation), // (floor)
• Expressions, unary, binary, hierarchy of priorities, exponentiation
• Variables.
Module 2
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
 Boolean values
 if-elif-else instructions
 The while and for loops
 Logical and bitwise operations
 >, <, >=, <=, ==, >>, <<
and, or, not, xor -> & (ampersand), | (bar), ~ (tilde), ^ (caret)
 Lists and arrays
 Sort, operations on list
Module 3
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Defining and using functions
• built-in, pre-installed, user-defines, lambda
• Different ways of passing arguments
• Parameters, arguments, return
• Name scopes
• Tuples and dictionaries
Module 4
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Module 1
• Module 2
• Module 3
• Module 4
PCEP – Python Certified Entry Programmer
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Python modules: their rationale, function, how to import them in
different ways, and present the content of some standard modules
provided by Python;
• The way in which modules are coupled together to make packages.
• The concept of an exception and Python's implementation of it,
including the try-except instruction, with its applications, and the raise
instruction.
• Strings and their specific methods, together with their similarities and
differences compared to lists.
Module 5
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• The object-oriented approach - foundations
• Classes, methods, objects, and the standard objective features
• Exception handling
• Working with files
Module 6
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Module 1
• Module 2
• Module 3
• Module 4
• Module 5
• Module 6
PCAP – Python Certified Associate Programmer
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Programming
Absolute basics
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Language is a means (and a tool) for expressing and recording
thoughts:
• Body language: it's possible to express your deepest feelings very
precisely without saying a word.
• Mother tongue: which you use to manifest your will and to think about
reality.
• Computers have their own language, too, called machine language,
which is very rudimentary.
• A complete set of known commands is called an Instruction List (IL)
• Different types of computers can vary depending on the size of your ILs
and the instructions can be completely different on different models.
Natural languages vs. programming languages
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• AN ALPHABET A set of symbols
• A LEXIS A dictionary
• A SYNTAX A set of rules (formal or informal)
• SEMANTICS A set of rules determining if a certain phrase makes sense
What makes a language?
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Computer language is far from a human mother tongue. We need
(both computers and humans) a language or a bridge between the
two different worlds.
• A language in which humans can write their programs and a
language that computers may use to execute the programs.
• Such languages are high-level programming languages. They use
symbols, words and conventions readable to humans. These
languages enable humans to express commands to computers
• A program written in a high-level programming language is called a
source code (in contrast to the machine code executed by computers)
or source file.
What makes a language?
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
There are two different ways
of transforming a program
from a high-level
programming language into
machine language:
Compilation vs. interpretation
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• https://www.youtube.com/watch?v=hPYCSu-_LPc&t=343s
Video: Compilation vs. interpretation (cont.)
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Compilation vs. interpretation
COMPILATION INTERPRETATION
ADVANTAGES
• The execution of the translated code is
usually faster.
• Only the user has to have the compiler - the
end-user may use the code without it.
• The translated code is stored using machine
language, your own inventions and
programming tricks are likely to remain your
secret.
• You can run the code as soon as you complete it
- there are no additional phases of translation;
• The code is stored using programming language,
not the machine one - this means that it can be
run on computers using different machine
languages; you don't compile your code
separately for each different architecture.
DISADVANTAGE
S
• The compilation itself may be a very time-
consuming process - you may not be able to
run your code immediately after any
amendment;
• You have to have as many compilers as
hardware platforms you want your code to
be run on.
• Don't expect that interpretation will ramp your
code to high speed - your code will share the
computer's power with the interpreter, so it can't
be really fast;
• Both you and the end user have to have the
interpreter to run your code.
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Easy to learn
• Easy to teach
• Easy to use
• Easy to understand
• Easy to obtain, install and deploy
What makes Python special?
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• low-level programming (sometimes called "close to metal"
programming): if you want to implement an extremely effective driver
or graphical engine, you wouldn't use Python;
• applications for mobile devices: although this territory is still
waiting to be conquered by Python, it will most likely happen
someday.
When not to use Python
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Python 3 is the current version of the language. It's going through its
own evolution path, creating its own standards and habits.
There is more than one Python
• Python 2 is an older version of the original
Python. Its development has since been
intentionally stalled, however the updates
are issued on a regular basis, but they are
not intended to modify the language in any
significant way.
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
In addition to Python 2 and Python 3, there is more than one version
Versions of Python
• Python aka Cpython
• Cython
• Jython
• PyPy and RPython
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
https://www.python.org/downloads/
How to get Python and how to get to use it
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Demo – How to use Python IDLE

More Related Content

Similar to Python Capitulo uno curso de programacion

LAS16-108: JerryScript and other scripting languages for IoT
LAS16-108: JerryScript and other scripting languages for IoTLAS16-108: JerryScript and other scripting languages for IoT
LAS16-108: JerryScript and other scripting languages for IoT
Linaro
 
IPT 2.pptx
IPT 2.pptxIPT 2.pptx
IPT 2.pptx
CHRISPay4
 
Top programming Languages in software Industry companies
Top programming Languages in software Industry companiesTop programming Languages in software Industry companies
Top programming Languages in software Industry companies
Kiran Patil
 
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
Prof. Wim Van Criekinge
 
Class_X_PYTHON_J.pdf
Class_X_PYTHON_J.pdfClass_X_PYTHON_J.pdf
Class_X_PYTHON_J.pdf
SanjeedaPraween
 
Python programming ppt.pptx
Python programming ppt.pptxPython programming ppt.pptx
Python programming ppt.pptx
nagendrasai12
 
Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - Serverless
David Delabassee
 
PYTHON UNIT 1
PYTHON UNIT 1PYTHON UNIT 1
PYTHON UNIT 1
nagendrasai12
 
An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()
Blue Elephant Consulting
 
Embedded programming Embedded programming (1).pptx
Embedded programming Embedded programming (1).pptxEmbedded programming Embedded programming (1).pptx
Embedded programming Embedded programming (1).pptx
lematadese670
 
Introduction to python history and platforms
Introduction to python history and platformsIntroduction to python history and platforms
Introduction to python history and platforms
Kirti Verma
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
michaelaaron25322
 
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET
Dmytro Mindra
 
Srikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latestSrikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latest
Srikanth Pilli
 
Compiler design
Compiler designCompiler design
Compiler design
Thakur Ganeshsingh Thakur
 
Python Introduction Presentation Part -1
Python Introduction Presentation Part -1Python Introduction Presentation Part -1
Python Introduction Presentation Part -1
CSC
 
Python-Yesterday Today Tomorrow(What's new?)
Python-Yesterday Today Tomorrow(What's new?)Python-Yesterday Today Tomorrow(What's new?)
Python-Yesterday Today Tomorrow(What's new?)
Mohan Arumugam
 
ch4-Software is Everywhere
ch4-Software is Everywherech4-Software is Everywhere
ch4-Software is Everywhere
ssuser06ea42
 
Putting Compilers to Work
Putting Compilers to WorkPutting Compilers to Work
Putting Compilers to Work
SingleStore
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
C4Media
 

Similar to Python Capitulo uno curso de programacion (20)

LAS16-108: JerryScript and other scripting languages for IoT
LAS16-108: JerryScript and other scripting languages for IoTLAS16-108: JerryScript and other scripting languages for IoT
LAS16-108: JerryScript and other scripting languages for IoT
 
IPT 2.pptx
IPT 2.pptxIPT 2.pptx
IPT 2.pptx
 
Top programming Languages in software Industry companies
Top programming Languages in software Industry companiesTop programming Languages in software Industry companies
Top programming Languages in software Industry companies
 
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
 
Class_X_PYTHON_J.pdf
Class_X_PYTHON_J.pdfClass_X_PYTHON_J.pdf
Class_X_PYTHON_J.pdf
 
Python programming ppt.pptx
Python programming ppt.pptxPython programming ppt.pptx
Python programming ppt.pptx
 
Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - Serverless
 
PYTHON UNIT 1
PYTHON UNIT 1PYTHON UNIT 1
PYTHON UNIT 1
 
An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()
 
Embedded programming Embedded programming (1).pptx
Embedded programming Embedded programming (1).pptxEmbedded programming Embedded programming (1).pptx
Embedded programming Embedded programming (1).pptx
 
Introduction to python history and platforms
Introduction to python history and platformsIntroduction to python history and platforms
Introduction to python history and platforms
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET
 
Srikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latestSrikanth_PILLI_CV_latest
Srikanth_PILLI_CV_latest
 
Compiler design
Compiler designCompiler design
Compiler design
 
Python Introduction Presentation Part -1
Python Introduction Presentation Part -1Python Introduction Presentation Part -1
Python Introduction Presentation Part -1
 
Python-Yesterday Today Tomorrow(What's new?)
Python-Yesterday Today Tomorrow(What's new?)Python-Yesterday Today Tomorrow(What's new?)
Python-Yesterday Today Tomorrow(What's new?)
 
ch4-Software is Everywhere
ch4-Software is Everywherech4-Software is Everywhere
ch4-Software is Everywhere
 
Putting Compilers to Work
Putting Compilers to WorkPutting Compilers to Work
Putting Compilers to Work
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 

Recently uploaded

PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
IJNSA Journal
 
Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
Madhumitha Jayaram
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
PauloRodrigues104553
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
Ratnakar Mikkili
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
wisnuprabawa3
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 

Recently uploaded (20)

PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
 
Wearable antenna for antenna applications
Wearable antenna for antenna applicationsWearable antenna for antenna applications
Wearable antenna for antenna applications
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
Series of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.pptSeries of visio cisco devices Cisco_Icons.ppt
Series of visio cisco devices Cisco_Icons.ppt
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
Exception Handling notes in java exception
Exception Handling notes in java exceptionException Handling notes in java exception
Exception Handling notes in java exception
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
New techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdfNew techniques for characterising damage in rock slopes.pdf
New techniques for characterising damage in rock slopes.pdf
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 

Python Capitulo uno curso de programacion

  • 2. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Intro
  • 3. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Introduction • The fundamentals of computer programming • Setting up your programming environment • Compilation vs. interpretation • Introduction to Python Module 1
  • 4. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Data types and the basic methods of formatting, converting, inputting and outputting data; • Literals • Integers, floats, strings, Boolean, octal, hexadecimal • Operators • + (addition), - (subtraction), * (multiplication), / (classic division), % (modulus), ** (exponentiation), // (floor) • Expressions, unary, binary, hierarchy of priorities, exponentiation • Variables. Module 2
  • 5. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential  Boolean values  if-elif-else instructions  The while and for loops  Logical and bitwise operations  >, <, >=, <=, ==, >>, << and, or, not, xor -> & (ampersand), | (bar), ~ (tilde), ^ (caret)  Lists and arrays  Sort, operations on list Module 3
  • 6. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Defining and using functions • built-in, pre-installed, user-defines, lambda • Different ways of passing arguments • Parameters, arguments, return • Name scopes • Tuples and dictionaries Module 4
  • 7. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Module 1 • Module 2 • Module 3 • Module 4 PCEP – Python Certified Entry Programmer
  • 8. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Python modules: their rationale, function, how to import them in different ways, and present the content of some standard modules provided by Python; • The way in which modules are coupled together to make packages. • The concept of an exception and Python's implementation of it, including the try-except instruction, with its applications, and the raise instruction. • Strings and their specific methods, together with their similarities and differences compared to lists. Module 5
  • 9. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • The object-oriented approach - foundations • Classes, methods, objects, and the standard objective features • Exception handling • Working with files Module 6
  • 10. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Module 1 • Module 2 • Module 3 • Module 4 • Module 5 • Module 6 PCAP – Python Certified Associate Programmer
  • 11. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Programming Absolute basics
  • 12. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Language is a means (and a tool) for expressing and recording thoughts: • Body language: it's possible to express your deepest feelings very precisely without saying a word. • Mother tongue: which you use to manifest your will and to think about reality. • Computers have their own language, too, called machine language, which is very rudimentary. • A complete set of known commands is called an Instruction List (IL) • Different types of computers can vary depending on the size of your ILs and the instructions can be completely different on different models. Natural languages vs. programming languages
  • 13. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • AN ALPHABET A set of symbols • A LEXIS A dictionary • A SYNTAX A set of rules (formal or informal) • SEMANTICS A set of rules determining if a certain phrase makes sense What makes a language?
  • 14. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Computer language is far from a human mother tongue. We need (both computers and humans) a language or a bridge between the two different worlds. • A language in which humans can write their programs and a language that computers may use to execute the programs. • Such languages are high-level programming languages. They use symbols, words and conventions readable to humans. These languages enable humans to express commands to computers • A program written in a high-level programming language is called a source code (in contrast to the machine code executed by computers) or source file. What makes a language?
  • 15. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential There are two different ways of transforming a program from a high-level programming language into machine language: Compilation vs. interpretation
  • 16. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • https://www.youtube.com/watch?v=hPYCSu-_LPc&t=343s Video: Compilation vs. interpretation (cont.)
  • 17. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Compilation vs. interpretation COMPILATION INTERPRETATION ADVANTAGES • The execution of the translated code is usually faster. • Only the user has to have the compiler - the end-user may use the code without it. • The translated code is stored using machine language, your own inventions and programming tricks are likely to remain your secret. • You can run the code as soon as you complete it - there are no additional phases of translation; • The code is stored using programming language, not the machine one - this means that it can be run on computers using different machine languages; you don't compile your code separately for each different architecture. DISADVANTAGE S • The compilation itself may be a very time- consuming process - you may not be able to run your code immediately after any amendment; • You have to have as many compilers as hardware platforms you want your code to be run on. • Don't expect that interpretation will ramp your code to high speed - your code will share the computer's power with the interpreter, so it can't be really fast; • Both you and the end user have to have the interpreter to run your code.
  • 18. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Easy to learn • Easy to teach • Easy to use • Easy to understand • Easy to obtain, install and deploy What makes Python special?
  • 19. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • low-level programming (sometimes called "close to metal" programming): if you want to implement an extremely effective driver or graphical engine, you wouldn't use Python; • applications for mobile devices: although this territory is still waiting to be conquered by Python, it will most likely happen someday. When not to use Python
  • 20. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Python 3 is the current version of the language. It's going through its own evolution path, creating its own standards and habits. There is more than one Python • Python 2 is an older version of the original Python. Its development has since been intentionally stalled, however the updates are issued on a regular basis, but they are not intended to modify the language in any significant way.
  • 21. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential In addition to Python 2 and Python 3, there is more than one version Versions of Python • Python aka Cpython • Cython • Jython • PyPy and RPython
  • 22. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential https://www.python.org/downloads/ How to get Python and how to get to use it
  • 23. © 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Demo – How to use Python IDLE

Editor's Notes

  1. 6. In Python strings the backslash (\) is a special character which announces that the next character has a different meaning, e.g., \n (the newline character) starts a new output line. 7. Positional arguments are the ones whose meaning is dictated by their position, e.g., the second argument is outputted after the first, the third is outputted after the second, etc. 8. Keyword arguments are the ones whose meaning is not dictated by their location, but by a special word (keyword) used to identify them. 9. The end and sep parameters can be used for formatting the output of the print() function. The sep parameter specifies the separator between the outputted arguments (e.g., print("H", "E", "L", "L", "O", sep="-"), whereas the end parameter specifies what to print at the end of the print statement.
  2. Computer programming is the act of composing the selected programming language's elements in the order that will cause the desired effect. The effect could be different in every specific case - it's up to the programmer's imagination, knowledge and experience. Of course, such a composition has to be correct in many senses: alphabetically - a program needs to be written in a recognizable script, such as Roman, Cyrillic, etc. lexically - each programming language has its dictionary and you need to master it; thankfully, it's much simpler and smaller than the dictionary of any natural language; syntactically - each language has its rules and they must be obeyed; semantically - the program has to make sense. Unfortunately, a programmer can also make mistakes with each of the above four senses. Each of them can cause the program to become completely useless. Let's assume that you've successfully written a program. How do we persuade the computer to execute it? You have to render your program into machine language. Luckily, the translation can be done by a computer itself, making the whole process fast and efficient.
  3. What does this all mean for you? Python is an interpreted language. This means that it inherits all the described advantages and disadvantages. Of course, it adds some of its unique features to both sets. If you want to program in Python, you'll need the Python interpreter. You won't be able to run your code without it. Fortunately, Python is free. This is one of its most important advantages. Due to historical reasons, languages designed to be utilized in the interpretation manner are often called scripting languages, while the source programs encoded using them are called scripts.
  4. DRAWBACKS - it's not a speed demon - Python does not deliver exceptional performance; - in some cases it may be resistant to some simpler testing techniques - this may mean that debugging Python's code can be more difficult than with other languages; fortunately, making mistakes is always harder in Python. it's easy to learn - the time needed to learn Python is shorter than for many other languages; this means that it's possible to start the actual programming faster; it's easy to teach - the teaching workload is smaller than that needed by other languages; this means that the teacher can put more emphasis on general (language-independent) programming techniques, not wasting energy on exotic tricks, strange exceptions and incomprehensible rules; it's easy to use for writing new software - it's often possible to write code faster when using Python; it's easy to understand - it's also often easier to understand someone else's code faster if it is written in Python; it's easy to obtain, install and deploy - Python is free, open and multiplatform; not all languages can boast that.
  5. Python rivals Python has two direct competitors, with comparable properties and predispositions. These are: Perl - a scripting language originally authored by Larry Wall; Ruby - a scripting language originally authored by Yukihiro Matsumoto.
  6. Stalled=estancado Todos los ejemplos de código que encontrarás durante el curso se han probado con Python 3.4, Python 3.6 y Python 3.7.
  7. PSF (Python Software Foundation)