Python Essentials 1: The Official OpenEDG Python Institute beginners course with practical exercises
9798987762202, 5551234567, 5557654321, 3456783958
Unleash Your Potential and Transform Your Life with Python Essentials 1 — Your Gateway to Career Success! Are you stuck
138
119
3MB
English
Pages 515
Year 2022
Report DMCA / Copyright
DOWNLOAD EPUB FILE
Table of contents :
Welcome to Python Essentials 1
Learn Python – the language of today and tomorrow
Introduction
About the course
Syllabus
Prepare for the PCEP-30-0x exam
Module 1: Introduction to Python and Computer Programming
Section 1.1 –Introduction to programming
How does a computer program work?
Compilation vs. Interpretation – Advantages and Disadvantages
Section 1.2 – Introduction to Python
Python – a tool, not a reptile
Who created Python?
A hobby programming project
There is more than one Python
Section 1.3 – Downloading and Installing Python
Begin your Python journey
Module 2: Python Data Types, Variables, Operators, and Basic I/O Operations
Section 2.1 – The "Hello, World!" Program
2.1.1 Your very first program
2.1.2 The print() function
2.1.3 Function arguments
2.1.4 Function invocation
LAB 1 Working with the print() function
2.1.5 The print() function and its effect, arguments, and values returned
2.1.6 Instructions
2.1.7 Python escape and newline characters
2.1.8 Using multiple arguments
2.1.9 Positional arguments
2.1.10 Keyword arguments
LAB 2 The print() function and its arguments
LAB 3 Formatting the output
2.1 SECTION SUMMARY
2.1 SECTION QUIZ
Section 2.2 – Python literals
2.2.1 Literals – the data in itself
2.2.2 Integers
2.2.3 Floats
2.2.4 Strings
2.2.5 Boolean values
LAB 4 Python literals – strings
2.2 SECTION SUMMARY
2.2 SECTION QUIZ
Section 2.3 – Operators: data manipulation tools
2.3.1 Python as a calculator
2.3.2 Basic operators
2.3.3 Operators and their priorities
2.3 SECTION SUMMARY
2.3 SECTION QUIZ
Section 2.4 – Variables
2.4.1 Variables – data-shaped boxes
2.4.2 Variable names
2.4.3 How to create a variable
2.4.4 How to use a variable
2.4.5 How to assign a new value to an already existing variable
2.4.6 Solving simple mathematical problems
LAB 5 Variables
2.4.7 Shortcut operators
LAB 6 Variables ‒ a simple converter
LAB 7 Operators and expressions
2.4 SECTION SUMMARY
2.4 SECTION QUIZ
Section 2.5 – Comments
2.5.1 Comments – why, when, and how?
2.5.2 Marking fragments of code
LAB 8 Comments
2.5 SECTION SUMMARY
2.5 SECTION QUIZ
Section 2.6 – Interaction with the user
2.6.1 The input() function
2.6.2 The input() function with an argument
2.6.3 The result of the input() function
2.6.4 The input() function – prohibited operations
2.6.5 Type casting (type conversions)
2.6.6 More about input() and type casting
2.6.7 String operators
2.6.8 Type conversions once again
LAB 9 Simple input and output
LAB 10 Operators and expressions
LAB 11 Operators and expressions 2
2.6 SECTION SUMMARY
2.6 SECTION QUIZ
Module 3: Boolean Values, Conditional Execution, Loops, Lists and List Processing, Logical and Bitwise Operations
Section 3.1 – Making decisions in Python
3.1.1 Questions and answers
3.1.2 Comparison: equality operator
3.1.3 Exercises
3.1.4 Operators
3.1.5 Making use of the answers
LAB 12 Variables ‒ Questions and answers
3.1.6 Conditions and conditional execution
3.1.7 Analyzing code samples
3.1.8 Pseudocode and introduction to loops
LAB 13 Comparison operators and conditional execution
LAB 14 Essentials of the if-else statement
LAB 15 Essentials of the if-elif-else statement
3.1 SECTION SUMMARY
3.1 SECTION QUIZ
Section 3.2 – Loops in Python
3.2.1 Looping your code with while
3.2.2 An infinite loop
3.2.3 The while loop: more examples
LAB 16 Guess the secret number
3.2.4 Looping your code with for
3.2.5 More about the for loop and the range() function with three arguments
LAB 17 Essentials of the for loop – counting mississippily
3.2.5 The break and continue statements
LAB 18 The break statement – Stuck in a loop
LAB 19 The continue statement – the Ugly Vowel Eater
LAB 20 The continue statement – the Pretty Vowel Eater
3.2.6 The while loop and the else branch
3.2.7 The for loop and the else branch
LAB 21 Essentials of the while loop
LAB 22 Collatz's hypothesis
3.2 SECTION SUMMARY
3.2 SECTION QUIZ
Section 3.3 – Logic and bit operations in Python
3.3.1 Computer logic
3.3.2 Logical expressions
3.3.3 Logical values vs. single bits
3.3.4 Bitwise operators
3.3.5 How do we deal with single bits?
3.3.6 Binary left shift and binary right shift
3.3 SECTION SUMMARY
3.3 SECTION QUIZ
Section 3.4 – Lists
3.4.1 Why do we need lists?
3.4.2 Indexing lists
3.4.3 Accessing list content
3.4.4 Removing elements from a list
3.4.5 Negative indices are legal
LAB 23 The basics of lists
3.4.6 Functions vs. methods
3.4.7 Adding elements to a list: append() and insert()
3.4.8 Making use of lists
3.4.9 Lists in action
LAB 24 The basics of lists ‒ the Beatles
3.4 SECTION SUMMARY
3.4 SECTION QUIZ
Section 3.5 – Sorting simple lists: the bubble sort algorithm
3.5.1 The bubble sort
3.5.2 Sorting a list
3.5.3 The bubble sort – interactive version
3.5 SECTION SUMMARY
3.5 SECTION QUIZ
Section 3.6 – Operations on lists
3.6.1 The inner life of lists
3.6.2 Powerful slices
3.6.3 Slices – negative indices
3.6.4 The in and not in operators
3.6.5 Lists – some simple programs
LAB 25 Operating with lists ‒ basics
3.6 SECTION SUMMARY
3.6 SECTION QUIZ
Section 3.7 – Lists in advanced applications
3.7.1 Lists in lists
3.7.2 Two-dimensional arrays
3.7.3 Multidimensional nature of lists: advanced applications
3.7 SECTION SUMMARY
Module 4: Functions, Tuples, Dictionaries, Exceptions, and Data Processing
Section 4.1 – Functions
4.1.1 Why do we need functions?
4.1.2 Decomposition
4.1.3 Where do functions come from?
4.1.4 Your first function
4.1.5 How functions work
4.1 SECTION SUMMARY
4.1 SECTION QUIZ
Section 4.2 – How functions communicate with their environment
4.2.1 Parameterized functions
4.2.2 Positional parameter passing
4.2.3 Keyword argument passing
4.2.4 Mixing positional and keyword arguments
4.2.5 Parametrized functions – more details
4.2 SECTION SUMMARY
4.2 SECTION QUIZ
Section 4.3 – Returning a result from a function
4.3.1 Effects and results: the return instruction
4.3.2 A few words about None
4.3.3 Effects and results: lists and functions
LAB 26 A leap year: writing your own functions
LAB 27 How many days: writing and using your own functions
LAB 28 Day of the year: writing and using your own functions
LAB 29 Prime numbers ‒ how to find them
LAB 30 Converting fuel consumption
4.3 SECTION SUMMARY
4.3 SECTION QUIZ
Section 4.4 – Scopes in Python
4.4.1 Functions and scopes
4.4.2 Functions and scopes: the global keyword
4.4.3 How the function interacts with its arguments
4.4 SECTION SUMMARY
4.4 SECTION QUIZ
Section 4.5 – Creating multi-parameter functions
4.5.1 Sample functions: Evaluating the BMI
4.5.2 Sample functions: Triangles
4.5.3 Sample functions: Factorials
4.5.4 Fibonacci numbers
4.5.5 Recursion
4.5 SECTION SUMMARY
4.5 SECTION QUIZ
Section 4.6 – Tuples and dictionaries
4.6.1 Sequence types and mutability
4.6.2 Tuples
4.6.3 Dictionaries
4.6.4 Dictionary methods and functions
4.6.5 Tuples and dictionaries can work together
4.6 SECTION SUMMARY
4.6 SECTION QUIZ
Section 4.7 – Exceptions
4.7.1 Errors – the developer's daily bread
4.7.2 When data is not what it should be
4.7.3 The try-except branch
4.7.4 The exception proves the rule
4.7.5 How to deal with more than one exception
4.7.6 The default exception and how to use it
4.7.7 Some useful exceptions
4.7.8 Why you can't avoid testing your code
4.7.9 When Python closes its eyes
4.7.10 Tests, testing, and testers
4.7.11 print debugging
4.7.12 Some useful tips
4.7.13 Unit testing – a higher level of coding
4.7 SECTION SUMMARY
4.7 SECTION QUIZ
Appendices
Appendix A: LAB Hints
Appendix B: LAB Sample Solutions
Appendix C: Answers
Appendix D: PCEP Exam Syllabus