From b6aed7a0b38bf189922dbc47ed802de3c9769b73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=90=86=E7=B5=B5=E5=AD=90?= <41843094+lowlevelware@users.noreply.github.com> Date: Sun, 29 Jul 2018 11:53:33 +0900 Subject: added example for f-string Literal string interpolation is new in python 3.6 [pep-0498](https://www.python.org/dev/peps/pep-0498/) --- python3.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'python3.html.markdown') diff --git a/python3.html.markdown b/python3.html.markdown index 019934cb..d6cfbf59 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -138,6 +138,10 @@ len("This is a string") # => 16 # still use the old style of formatting: "%s can be %s the %s way" % ("Strings", "interpolated", "old") # => "Strings can be interpolated the old way" +# You can also format using f-strings or formatted string literals +name = "Reiko" +f"She said her name is {name}." # => "She said her name is Reiko" + # None is an object None # => None -- cgit v1.2.3