python补充知识

文章目录

  • 1 print输出不换行
  • 2 制表符\t对齐字符串


1 print输出不换行

在print语句中加上end = “”/''即可输出不换行

print("hello", end = " ")
print("world", end = " ")
hello world 

print("hello", end = "")
print("world", end = "")
helloworld

print("hello", end = '')
print("world", end = '')
helloworld

2 制表符\t对齐字符串

效果等同于tab键,让多行字符串进行对齐

print("hello\tworld")
print("love\tyou")
hello	world
love	you

你可能感兴趣的:(python基础入门,python,开发语言)