课程: Advanced Python: Build Hands-On Projects with Design Patterns (2023)

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Solution: Handling transactions gracefully

Solution: Handling transactions gracefully

- [Instructor] Did you figure out the code? How was the experience? The challenge has a missing text in the Check class. Let's add the correct text, which is "Checking". We also need to add individual actions to our Transaction object. Let's add the identify action first. Type transaction.add (Identify()). Type transaction.add (Verify()). Type transaction.add (Check()). Let's also run the transaction and return the result as our last step. Transaction.run(). We are all set now. Let's test the code by clicking on Test my code. It produces the right string that says "Checking ...", well done.

内容