info_tuple = ("王五", 18, 1.88)
# 格式化字符串后面的小括号本质上就是一个元组
print("%s年龄是%d,身高%.2f" % info_tuple)
info_str = "%s年龄是%d,身高%.2f" % info_tuple
print(info_str)
python元组:格式化字符串
最新推荐文章于 2024-06-24 10:05:24 发布
info_tuple = ("王五", 18, 1.88)
# 格式化字符串后面的小括号本质上就是一个元组
print("%s年龄是%d,身高%.2f" % info_tuple)
info_str = "%s年龄是%d,身高%.2f" % info_tuple
print(info_str)