age = 18
weight = 64
print("我的名字是%s,我的国籍是%s"%("小张","中国"))
print("我的年龄:%d岁"%age)
print("我的年龄:%d岁,体重是%dkg"%(age,weight))

print("aaa","bbb","ccc")
print("www","baidu","com",sep=".")

print("hello",end="")
print("world",end="\t")
print("python",end="\n")
print("end")

python的基本格式化输出

 以上是一些比较常用的格式化输出

相关文章:

  • 2021-08-20
  • 2021-11-01
猜你喜欢
  • 2021-11-28
  • 2021-05-29
  • 2022-02-08
  • 2021-12-28
  • 2021-11-30
  • 2021-07-31
  • 2022-01-02
相关资源
相似解决方案