标签:需要 iat median com python ring 引号 lin you
多行字符串使用fstring需要注意每行都要加fstring
>>> name = "Eric"
>>> profession = "comedian"
>>> affiliation = "Monty Python"
>>> message = (
... f"Hi {name}. "
... f"You are a {profession}. "
... f"You were in {affiliation}."
... )
>>> message
'Hi Eric. You are a comedian. You were in Monty Python.'
如果使用三个双引号
>>> message = f"""
... Hi {name}.
... You are a {profession}.
... You were in {affiliation}.
... """
...
>>> message
'\n Hi Eric.\n You are a comedian.\n You were in Monty Python.\n'
标签:需要 iat median com python ring 引号 lin you
原文地址:https://www.cnblogs.com/c-x-a/p/11320362.html