Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Update Exceptions_FileIO lab #11

Open
crsawyer314 opened this issue Oct 6, 2021 · 0 comments
Open

Suggestion: Update Exceptions_FileIO lab #11

crsawyer314 opened this issue Oct 6, 2021 · 0 comments

Comments

@crsawyer314
Copy link

It has come to my attention that the Exceptions and File IO lab has a section on string manipulation. It mentions format strings, but never mentions f strings. These are a more readable, more concise, and less prone to error than other ways of formatting, and they are also faster.

Example: In the third-to-last code block of the lab, you have the following code:
print("Is today {} {}, {}?".format(day, month, year))
Which could be simplified to the following using an f-string:
print(f"Is today {day} {month}, {year}?")

In addition, the statement " The comma after the print command suppresses the automatic newline character, keeping the output of each individual print statement on the same line" is no longer correct, and does not reflect the code as it is in the lab currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant