Python Development: Creating Classes, Handling Errors, & Importing Modules


Overview/Description
Expected Duration
Lesson Objectives
Course Number
Expertise Level



Overview/Description
Python classes act like blueprints for establishing a new type of object with its own set of properties and methods. In this course, you'll learn how to define and instantiate classes in Python. You'll start by using the init() method to initialize your class's member variables and the self keyword to reference a class's current instance. You'll then illustrate the differences between the self keyword in Python and the "this" keyword in Java. Next, you'll examine how errors in Python can be handled using the try-except-finally block and how the error handling mechanism in Python is similar to Java exception handling. Finally, you'll import other Python libraries into your current Python program, using classes and functions defined in one Python file in another file using the import statement. When you're finished with this course, you'll be able to set up Python classes for various uses in your development projects.

Expected Duration (hours)
1.3

Lesson Objectives

Python Development: Creating Classes, Handling Errors, & Importing Modules

  • discover the key concepts covered in this course
  • define and use classes in Python
  • initialize classes using the __init__() method
  • use try and except blocks to catch potential errors in code
  • use the finally block to write clean up code
  • import modules into your current program
  • reference a custom module written in a different Python file
  • pass and reference command line arguments in Python
  • summarize the key concepts covered in this course
  • Course Number:
    it_pypjcddj_06_enus

    Expertise Level
    Beginner