Skip to content

PEP 498

Literal String Interpolation (f"..." 이거)

!s, !r, and !a are redundant

  • !r - repr 호출
  • !s - str 호출
  • !a - ascii 호출

Example

>>> a = 'some string'
>>> f'{a!r}'
"'some string'"

Is identical to:

>>> f'{repr(a)}'
"'some string'"

See also

Favorite site