We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
name = 'Bill' age = 20 def getAge(): return 21 s = f"我是{name},我今年{age}岁,明年{getAge()}岁" print(s) class Person: def __init__(self): self.name = 'Mike' self.age = 40 def getAge(self): return 41 person = Person() s1 = f"我是{person.name},我今年{person.age}岁,明年{person.getAge()}岁" print(s1)
fstring方式是指在字符串中直接使用Python变量,这需要在字符串前面用f标注。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
fstring方式是指在字符串中直接使用Python变量,这需要在字符串前面用f标注。
The text was updated successfully, but these errors were encountered: