【发布时间】:2017-12-01 17:14:53
【问题描述】:
我知道 python 3.6 中新的 f 字符串做了什么,但是下面的代码片段中的结尾 !r 呢。
def __repr__(self):
return (f'Pizza({self.radius!r}, 'f'{self.ingredients!r})')
【问题讨论】:
-
对不起,标题中的 a,不知道“a”是怎么进来的。
标签: python python-3.6 f-string