【Python第二章】2.7题
# 格式化输出
开始编译:
name = "XiaoMing"
height = 179.8
weight = 75.0
print(f"Name:{name};Height:{height}cm;Weight:{weight}kg;")
print("Name:{};Height:{}cm;Weight:{}kg;".format(name, height, weight))
运行结果:
Name:XiaoMing;Height:179.8cm;Weight:75.0kg;
Name:XiaoMing;Height:179.8cm;Weight:75.0kg;
Views: 170