username = input("用户名:")
print(f'{username}')
1:{username} 表示username会作为变量传值。
2:这里的f 代表什么含义?
python3.6的新特性,format的意思格式化输出。
f’{username}’ 等价于 ’ {username} '.format(username=username)
本文介绍了Python 3.6中引入的f-string特性,解释了如何使用f-string进行格式化输出,以及它与传统format方法之间的等价关系。
username = input("用户名:")
print(f'{username}')
1:{username} 表示username会作为变量传值。
2:这里的f 代表什么含义?
python3.6的新特性,format的意思格式化输出。
f’{username}’ 等价于 ’ {username} '.format(username=username)
1141
1822

被折叠的 条评论
为什么被折叠?