Introduction to Python Programming Course



Course Details:

Length: 4 days

Price: $2,700/person (USD)

Bundle & Save: View Bundle

Group Price: Request Quote

Training Reviews

Course Features:

Live Instructor Teaching

Certificate of Completion

Courseware: Print

Free 6 Month Online Retake

Hands-On Learning?: Yes

Software Lab Included?: Yes

Delivery Methods:

Live Online

Individuals and Groups
@ Your Location

Onsite for Teams

Group Teams
@ Your Organization

This is an instructor-led course. It is taught by an instructor live online or at organizations for groups.
For team training, we can teach onsite at your office or private live online.

 

Course Overview

In this Python training course, students learn to program in Python. The course is aimed at students new to the language who may or may not have experience with other programming languages. Topics covered:

  • How Python works.
  • Python's place in the world of Programming languages.
  • Python literals.
  • Python comments.
  • Variables and Python data types.
  • Simple modules.
  • Outputting data with print ().
  • Collecting user input.

Register Early: Registration Deadline is 2 Weeks Prior to Class Start.


Course Notes

Versions That Can Attend: Python 2, Python 3, and Python 3.8 (differences between the versions are noted)
Course Taught With: Python 3.8 Software and Courseware


Suggested Follow-Ons

Advanced Python Programming

 

Course Topics

Lesson 1: Python Basics - 1
Getting Familiar with the Terminal
Running Python
Running a Python File
• Exercise 1: Hello, world!
Literals
Python Comments
Data Types
• Exercise 2: Exploring Types
Variables
• Exercise 3: A simple Python Script
Constants
Deleting Variables
Writing a Python Module
print() Function
• Exercise 4: Hello, You!
Collecting User Input
Reading from and Writing to Files
• Exercise 5: Working with Files

Lesson 2: Functions and Modules - 31
Defining Functions
Variable Scope
Global Variables
Function Parameters
• Exercise 6: A Function with Parameters
Returning Values
• Exercise 7: Parameters with Default Values
Importing Modules
Methods vs. Functions

Lesson 3: Math - 49
Arithmetic Operators
• Exercise 8: Floor and Modulus
Assignment Operators
Precedence of Operations
Built-in Math Functions
The math Module
The random Module
• Exercise 9: How Many Pizzas Do We Need?
• Exercise 10: Dice Rolling

Lesson 4: Python Strings - 69
Quotation Marks and Special Characters
String Indexing
• Exercise 11: Indexing Strings
Slicing Strings
• Exercise 12: Slicing Strings
Combining Concatenation and Repetition
• Exercise 13: Repetition
Python Strings are Immutable
Common String Methods
String Formatting
• Exercise 14: Playing with Formatting
Formatted String Literals (f-strings)
Built-in String Functions
• Exercise 15: Outputting Tab-delimited Text

Lesson 5: Iterables: Sequences, Dictionaries, and Sets - 111
Definitions
Sequences
Lists
Sequences and Random
• Exercise 16: Remove and Return Random Element
Tuples
Ranges
Converting Sequences to Lists
Indexing
• Exercise 17: Simple Rock, Paper, Scissors Game
Slicing
• Exercise 18: Slicing Sequences
min(), max(), and sum()
Covering Sequences to Strings with Str.join(seq)
Splitting Strings into Lists
Unpacking Sequences
Dictionaries
The len() Function
• Exercise 19: Creating a Dictionary from User Input
Sets
*args and **kwargs

Lesson 6: Virtual Environments, Packages, and pip - 149
• Exercise 20: Creating, Activating, Deactivating, and Deleting a Virtual Environment
Packages with pip
• Exercise 21: Working with a virtual Environment

Lesson 7: Flow Control - 159
Conditional Statements
Compound Conditions
The is and is not Operators
all() and any0
Ternary Operator
In Between
Loops in Python
• Exercise 22: All True and Any True
break and continue
Looping through Lines in a File
• Exercise 23: Word Guessing Game
• Exercise 24: for. else
The enumerate() Function
Generators
List Comprehensions

Lesson 8: Exception Handling - 215
Exception Basics
Wildcard except Clauses
Getting Information on Exceptions
• Exercise 25: Raising Exceptions
The else Clause
The finally Clause
Using Exceptions for Flow Control
• Exercise 26: Running Sum
Raising Your Own Exceptions

Lesson 9: Python Dates and Times - 231
Understanding Time
The time Module
Time Structures
Times as Strings Time and Formatted Strings
Pausing Execution with time.sleep()
The datetime Module
datetime.datetime Objects
• Exercise 27: What Color Pants Should I Wear?
dateumetimedelta Objects
• Exercise 28: Report on Departure Times

Lesson 10: File Processing - 261
Opening Files
• Exercise 29: Finding Text in a File
Writing to Files
• Exercise 30: Writing to Files
• Exercise 31: List Creator
The os Module
Walking a Directory
The os.path Module
A Better Way to Open Files
• Exercise 32: Comparing Lists

Lesson 11: PEP8 and Pylint - 295
PEP8
Pylint


Course FAQs

What Are the Available Class Formats?

This course is taught by a live instructor and is available in two class formats:

  1. Live Online for Individuals
  2. Onsite/Online for Private Groups

What Are Python Basics?

Python basics are the fundamental concepts of the Python programming language. They include running Python, literals, variables, comments, data types, constants, deleting variables, writing a python module, print() function, and collecting user input. By understanding these basics of Python, you will have the foundation you need to start coding in Python.

The Terminal

To begin let us look at running Python. To run Python you will need to type commands into a terminal window on your computer. This is the main way of using Python, but there are other options for coding in Python such as online IDEs and text editors.

Literals

Literals are data values written directly into code without being assigned to any variable or constant. Python supports strings, numbers, lists, tuples, sets, and dictionaries as literals.

Comments

Python comments are lines of text in the code which do not get executed when the program is run. Comments can be used to explain what different parts of a program do and to help others read your code more easily.

Data Types

Data types are the type of data that a variable can store. Python has several different data types such as integers, floats, strings, lists, and dictionaries.

Variables

Variables are used to store data in your program. They can be assigned any kind of value including constants or literal values. It is good practice to give meaningful names to variables which will help you and others understand your code.

Scripts

Scripts are a way of writing Python programs that will be executed when they run. Scripts typically contain a series of instructions that the computer follows to perform some task.

Constants

Constants are values that never change during program execution. They can be used to store data such as mathematical constants or to indicate flags that control the behavior of a program.

Deleting Variables

Deleting variables is an important task when programming in Python as it will help you keep your programs running efficiently and with fewer errors. Variables can be deleted using the del keyword followed by the name of the variable you wish to delete.

Writing a Module

Writing a Python module is a process of creating a file containing Python code that can be imported into other programs. Modules allow you to write code once and use it multiple times in different programs.

print() Function

The print() function prints output on the screen when your program runs. It is one of the most commonly used functions in Python as it allows you to display information to the user.

Collecting User Input

Collecting user input is another common task in Python programming. This can be done using built-in functions such as input() or raw_input() which allow you to collect data from the user.

Reading and Writing Files

Reading from and writing to files is also an important task in Python programming as it allows you to store data on your computer. The open() function is used to open a file and the functions read() and write() can be used to read from or write to a file respectively.

What Are Python Functions and Modules?

Python functions are blocks of code that can be reused to perform specific operations. Each function is defined with its own set of parameters, which are the values that the function needs to work properly. Additionally, each function has a scope, which defines where in the program it can be used and how its variables will behave when called from different locations.

There are two main types of variables used in functions: global and local. Global variables can be accessed anywhere in the program, while local variables are only available within the function itself. The scope of each variable is determined by where it is declared.

Function parameters are values that are passed into a function when it is called, allowing the function to be customized for different scenarios. Parameters are specified within the parentheses of a function call, and they must match the parameters defined in the function definition.

A return statement is used to return data from a function back to its caller. This allows functions to act as a filter and output only the values that are needed by other parts of the program.

Modules provide a way to organize and share code between different Python programs. Importing modules allows you to access functions, classes, variables, and other elements defined in those modules from within your code.

It is important to note that methods are functions that are part of a class or object, and they can only be called on that class or object. Functions, on the other hand, are standalone pieces of code that can be called from anywhere in the program.

Python functions and modules provide powerful tools for writing efficient, reusable code. By understanding variables and their scopes, parameters, returning values, and methods vs. functions, you can create code that is easier to read and maintain.

What Is Python Math?

Python math is a powerful tool for performing mathematical calculations. It includes basic arithmetic operations, assignment operators, and the ability to control the precedence of operations. Python also offers an extensive library of built-in math functions, as well as access to the math module and random module for more advanced computational tasks. Arithmetic operators are symbols that allow us to perform basic operations such as addition, subtraction, multiplication, and division. Assignment operators allow us to assign a value to a variable. Precedence of operations is important when it comes to computing complex equations or expressions with multiple steps; it allows us to control the order in which the calculations are performed.

Python's built-in math functions enable us to perform more complex calculations such as finding the square root of a number, calculating exponents, and trigonometry. The math module provides access to more advanced mathematical functions such as logarithms, hyperbolic functions, and special mathematical constants. For projects involving randomness or probability, the random module is an ideal choice as it contains many predefined functions for generating random numbers. Python math is a powerful tool and provides numerous options for performing mathematical calculations quickly, accurately, and efficiently.

By understanding the basic concepts of arithmetic operations, assignment operators, precedence of operations, and built-in math functions, we can make full use of Python's capability to help us with our tasks.

What Are Python Strings?

Python strings are an essential building block in any Python program. A string is a sequence of characters, surrounded by either single or double-quoted marks.

Strings provide many useful features and methods for manipulating text, such as indexing (accessing specific characters) and common methods like lower(), upper(), split(), startswith(), and endswith(). Python provides a way to perform string formatting using formatted string literals (f-strings). This is especially useful for creating strings from variables or expression results. Python also offers many built-in functions for working with and manipulating strings, such as capitalize(), count(), join(), replace(), format(), and strip() to name a few.

With the help of these functions and methods, you can create powerful programs with strings that go beyond simple character manipulation. As you become more comfortable with Python, you will undoubtedly find yourself using strings in many different ways. Python is a great language to learn string manipulation, and by understanding the fundamentals of how strings work, you can create amazing programs.

What Are Python Iterables: Sequences, Dictionaries, and Sets?

Python is an incredibly powerful programming language, and one of the pillars of its power is the ability to work with iterables. Iterables are collections of items, such as sequences, dictionaries, and sets. Each type of iterable has its specific definitions and capabilities for use in Python programs.

A sequence is a collection of items that can be accessed via an index. The index can be defined as the position of the item in the collection, and this allows for easy retrieval of specific elements from the sequence. Common examples of sequences include lists, tuples, and strings.

A dictionary is a collection of key-value pairs, also known as mappings. Unlike a sequence, the items in a dictionary can be accessed using their associated key, rather than their index. The keys and values are separated by a colon (:), and the items are contained within curly brackets ({}).

Finally, sets are collections of unique elements. This means that each item can only exist once in the set, and therefore the order of items won’t matter. You can use sets on their own or as a complement to other iterables, such as dictionaries.

Python iterables are incredibly powerful tools, and understanding how to work with them is essential for becoming an effective Python programmer. Knowing which type of iterable to use in a given situation and how to interact with it can greatly simplify your code and make it more efficient.

What Are Python Virtual Environments, Packages, and pip?

Python Virtual Environments (also known as pyvenv or venv) are isolated working copies of Python that allow developers to work on specific projects without affecting the main installation of Python. This allows for multiple versions of Python and packages to be used side-by-side, which is especially useful when developing applications with differing requirements.

Packages are bundles of reusable code that allow developers to perform a particular task without needing to rewrite the same functionality. Packages can be installed using Python's pip (a package manager) which allows for quick and easy installation, updating, and removal of packages. Pip makes it easier for developers to manage their project dependencies, allowing them to easily add, remove, and update packages as needed.

Python Virtual Environments, Packages, and pip are all important tools for developers working with Python, allowing them to work efficiently and quickly manage their project dependencies.

What Is Python Flow Control?

Flow control allows you to control the execution of your code, depending on certain conditions being met. Conditional statements are used to evaluate whether a statement is True or False, and execute different blocks of code accordingly. In Python, this is done using the if, elif (else if), and else keywords.

Compound conditions are a combination of multiple conditions using the AND or OR keywords, allowing you to create complex logic. In addition, Python has the IS and IS NOT operators which are useful when comparing objects. The all() and any() functions can be used to check if all elements in an iterable are True, or if at least one element is True respectively.

The ternary operator allows you to simplify the syntax of an if-else statement, by providing a shorter version of the same logic. The in and not in keywords are used to check whether values are within a sequence or not.

Loops are used for iterating over sequences, such as lists, tuples, or strings. The break and continue keywords are useful for exiting or skipping parts of a loop respectively. Looping through lines in a file involves using the readline() function, while the enumerate() function can be used to keep track of the index while looping.

Generators allow you to compute values one at a time, instead of creating an entire sequence in memory. Finally, list comprehensions are a way to construct lists more concisely than using for-loops.

Flow control is a key concept when programming with Python, as it allows you to create complex logic and control the execution of your code. It involves making use of conditionals, loops and other tools to achieve the desired result.

What Is Python Exception Handling?

Python Exception Handling is an important concept to understand when working with the language. It enables a program to detect errors and respond gracefully by avoiding unexpected behavior, such as crashing or generating incorrect results.

The basic idea behind exception handling is to provide a structured way of dealing with errors that occur in code during runtime. When an exception occurs, a corresponding statement is executed, allowing the program to respond appropriately.

Wildcard except clauses is useful for catching all exceptions regardless of their type. This can be helpful in debugging code or ensuring that code doesn't crash when errors occur. However, it should generally be avoided as it may mask underlying problems and can lead to unexpected behavior.

Getting information on exceptions is key to debugging code. This can be done by accessing the variables associated with each exception type, such as the error message, line number, and traceback. This allows developers to get a better understanding of what went wrong and how to improve their code.

The else clause is used in combination with try-except blocks to execute code if no exceptions occur. This can be useful for ensuring that code runs as expected, without any unexpected errors interrupting the flow of execution.

The finally clause allows developers to specify a block of code that will always run regardless of whether an exception is caught or not. This ensures that resources are correctly freed up and routines are always completed, even in the presence of errors.

Exceptions can also be used for flow control, such as to break out of multiple nested loops or to return from a deeply nested function call. This allows developers to create more efficient programs by avoiding redundant code and simplifying complex logic.

Finally, it is possible to raise your exceptions using the raise keyword. This can be useful for signaling errors within a program and allows developers to create custom error messages tailored to their specific needs. Code that raises an exception also has the chance to provide additional context on what went wrong and how it can be fixed.

By understanding these concepts, developers can write more reliable code that is easier to maintain and debug. Python Exception Handling is an important tool for writing robust code and should be in every programmer's toolkit.

What Are Python Dates and Times?

Python dates and times are objects that allow users to store, calculate and manipulate calendar-based information. With Python's datetime function, you can access a wide range of features to create intelligent time-related programs. For example, you can create a program that calculates the days until an upcoming event or includes time formatting for any user input. Python's dates and times objects provide the tools necessary to access, calculate, and manipulate information related to the calendar. With various methods available for use in Python, you can easily create powerful programs that utilize time-based data. As an example, a program might include different calculations based on user input or automatically display the number of days until a specific event.

With Python's datetime library, the possibilities are endless. Whether you need to access time-based data or manipulate calendar information, Python dates and times offer the features necessary for complex programming projects.

What Is Python File Processing?

Python file processing is an essential skill for any Python programmer. File processing can be used to read and write data from files, as well as manage them with the os module.

When opening a file, you must specify the mode in which it will be opened (e.g. 'w' for writing). Once the file is opened, you can then write to it using the file.write() method. If you wish to read from a file, use the file.read() method to retrieve the data within it.

The os module provides a range of useful functions for manipulating files and directories on your system such as creating, deleting, and renaming them. It also provides functions to move the current working directory and information on the contents of a directory.

The os.path module provides more advanced handling of paths, such as joining multiple path names together and returning just the file name or directory name from a given path. This is especially useful when dealing with complex file structures across different operating systems.

Python file processing is a powerful tool for managing data and files within your system. With the right knowledge, you can use it to unlock a whole range of possibilities in Python programming.

What Is Python PEP8 and Pylint?

Python PEP8 and Pylint are two tools developed to help developers write clean and compliant code.

PEP8 is a style guide for Python programming language, which outlines coding conventions and best practices. It encourages the use of standardized syntax and formatting to improve the readability, maintainability, consistency, and overall quality of Python code.

Pylint is an open-source static code analysis tool for Python that checks for programming errors, helps to enforce coding standards, and provides suggestions for improving the style of code. Pylint can run against both Python 2 and 3 versions of code, making it a versatile linter capable of identifying and fixing errors in code quickly and efficiently.

Together, PEP8 and Pylint make it easier for developers to identify, understand, and debug their code. By following the guidelines of PEP8 and incorporating Pylint into your development process, you can ensure that you are creating quality code that meets industry standards. This makes Python projects faster, more reliable, and more consistent in the long run.

 

Explore Python Classes Near Me

 

 



Start your training today!