reading-notes

401 Class 3 Reading Notes

Summary: This class is about FileIO & Exceptions

Read & Write Files in Python

-Raise allows you to throw an exception at any time. -Assert enables you to verify if a certain condition is met and throw an exception if it isn’t. -In the try clause, all statements are executed until an exception is encountered. -Except is used to catch and handle the exception(s) that are encountered in the try clause. -Else lets you code sections that should run only when no exceptions are encountered in the try clause. -Finally enables you to execute sections of code that should always run, with or without any previously encountered exceptions.

open(‘file’) file.close() -encoding is a translation from byte data to human readable characters. Exceptions in Python Quiz

Sources:

https://realpython.com/read-write-files-python/#what-is-a-file https://realpython.com/python-exceptions/ https://realpython.com/quizzes/read-write-files-python/viewer/

Things I want to know more about:

Procedural signs or prosigns