📜  如何为字符串设置条件以显示或不显示 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:54.634000             🧑  作者: Mango

代码示例2
>>> s = "At least, that's what {pronoun} told me.".format(pronoun="he" if gender == "male" else "she")
>>> s
"At least, that's what he told me."