jakevdp / WhirlwindTourOfPython

The Jupyter Notebooks behind my OReilly report, "A Whirlwind Tour of Python"
Creative Commons Zero v1.0 Universal
3.73k stars 1.61k forks source link

Added examples of f-string usage in 'Strings-and-Regular-Expressions.ipynb' #28

Open akhaund opened 3 years ago

akhaund commented 3 years ago

Added examples of f-string usage to string formatting section.

  1. f"The value of pi is {pi}"

  2. first, last = 'A', 'Z' f"""First letter: {first}. Last letter: {last}."""

  3. f"pi = {pi:.3f}"

  4. print(f"{pi=}")