Skip to content

Change .format() strings into f"" strings #49

@Scottan

Description

@Scottan

Throughout the course, we should replace str.format() strings with formatted string literals ("f" strings).

https://realpython.com/python-f-strings/

They're clearer to read, quicker to write when giving the lesson and the Python recommended style to use. I'd also recommend replacing statements like print("abc", x, "def", y) with print(f"abc {x} def {y}"), although that is more work and less important.

We should probably add a box in the introduction about using f-strings and comparing them to str.format()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions