- Home
- IT Courses
- Python Introduction (v3.8)
Python Introduction (v3.8)
Course Code: PY-INP
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. The course was written using Python 3.8, but is relevant for all students using Python 3.
This course is intended for students who would like to learn Python programming and may or may not have programming experience.
Before attending this course, students must have:
- Some programming experience (recommended but not compulsory)
- Learn how Python works and what it is good for
- Understand Python's place in the world of programming languages
- Learn to work with and manipulate strings in Python
- Learn to perform math operations with Python
- Learn to work with Python sequences: lists, arrays, dictionaries, and sets
- Learn to collect user input and output results
- Learn flow control processing in Python
- Learn to write to and read from files using Python
- Learn to write functions in Python
- Learn to handle exceptions in Python
- Learn to work with dates and times in Python
There is no associated exam for this course.
Modules
- Getting Familiar with the Terminal
- Running Python
- Running a Python file
- Collecting User Input
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
- Collecting User Input
Exercise 4: Hello, You!
- Reading from and Writing with Files
Exercise 5: Working with Files
- Defining Functions
- Variable Scope
- Global Variables
- Function Parameters
Exercise 6: A Function with Parameters
- Default Values
Exercise 7: Parameters with Default Values
- Returning Values
- Importing Modules
- Methods vs. Functions
- Arithmetic Operators
Exercise 8: Floor and Modulus
- Assignment Operators
- Precedences of Operations
- Built-in Math Functions
- The math Module
- The random Module
Exercise 9: How many Pizzas Do We Need?
Exercise 10: Dice Rolling
- Quotation Marks and Specials Characters
- String Indexing
Exercise 11: Indexing Strings
- Slicing Strings
Exercise 12: Slicing Strings
- Concatenation and Repetition
Exercise 13: Repetition
- Combining Concatenation and Repetition
- Python Strings are Immutable
- Common String Methods
- String Formatting
Exercise 14: Playing with Formatting
- Formatting String Literals (f-strings)
- Built-in String Functions
Exercise 15: Outputting Tab-delimited Text
- 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()
- Converting 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
Exercise 20: Creating, Activating, Deactivating, and Deleting a Virtual Environment
- Packages with pip
Exercise 21: Working with a Virtual Environment
- Conditional Statements
- Compound Conditions
- The is and is not Operators
- all() and any()
- 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
- 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
- Understanding Time
- The time Module
- Time Structures
- Time as Strings
- 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?
- Datetime.timedelta Objects
Exercise 28: Report on Departure Time
- 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
- PEP8
- Pylit