Python Chapter 1vcurso
Python Chapter 1vcurso
Intro
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Module 1
• Introduction
• The fundamentals of computer programming
• Setting up your programming environment
• Compilation vs. interpretation
• Introduction to Python
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Module 2
• 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.
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Module 3
Boolean values
if-elif-else instructions
The while and for loops
Logical and bitwise operations
>, <, >=, <=, ==, >>, <<
and, or, not, xor -> & (ampersand), | (bar), ~ (tilde), ^ (caret)
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Module 4
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
PCEP – Python Certified Entry Programmer
• Module 1
• Module 2
• Module 3
• Module 4
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Module 5
• 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.
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Module 6
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
PCAP – Python Certified Associate Programmer
• Module 1
• Module 2
• Module 3
• Module 4
• Module 5
• Module 6
© 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
•
Natural languages vs. programming languages
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.
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
What makes a language?
• A LEXIS A dictionary
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
What makes a language?
• https://www.youtube.com/watch?v=hPYCSu-_LPc&t=343s
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Compilation vs. interpretation
COMPILATION INTERPRETATION
• The execution of the translated code is usually • You can run the code as soon as you complete it -
faster. there are no additional phases of translation;
• Only the user has to have the compiler - the end- • The code is stored using programming language, not
user may use the code without it. the machine one - this means that it can be run on
• The translated code is stored using machine computers using different machine languages; you
ADVANTAGES
language, your own inventions and programming don't compile your code separately for each different
tricks are likely to remain your secret. architecture.
• The compilation itself may be a very time- • Don't expect that interpretation will ramp your code to
consuming process - you may not be able to run high speed - your code will share the computer's power
your code immediately after any amendment; with the interpreter, so it can't be really fast;
• You have to have as many compilers as • Both you and the end user have to have the interpreter
DISADVANTAGES hardware platforms you want your code to be to run your code.
run on.
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
What makes Python special?
• Easy to learn
• Easy to teach
• Easy to use
• Easy to understand
• Easy to obtain, install and deploy
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
When not to use Python
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
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.
• Python 3 is the current version of the language. It's going through its
own evolution path, creating its own standards and habits.
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Versions of Python
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
How to get Python and how to get to use it
https://www.python.org/downloads/
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Demo – How to use Python IDLE
© 2018 Cisco and/or its affiliates. All rights reserved. Cisco Confidential