syntax difference

Ben Bacarisse ben.usenet at bsb.me.uk
Sat Jun 16 21:55:44 EDT 2018


Cameron Simpson <cs at cskk.id.au> writes:
<snip>
> ... In Python 3 we have "format strings", which let you write:
>
>  name = "Sharon"
>  age = 35
>  print(f"The person named {name|r} is {age} years old.")

You meant {name!r} I think there.

-- 
Ben.



More information about the Python-list mailing list