赞
踩
login="123"
def test():
print(f"the value={login}")
test()
运行结果
the value=123
结果说明 f开头表示在字符串内支持大括号内的python 表达式
python输出函数加上f的作用:即print(f" ")
主要作用就是格式化字符串,加上f以后,{“变量/表达式”},花括号里的变量和表达式就可以使用了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。