python 打印/输入语句的使用

print("Hello World!")
print("hello" * 3)          # 输出3个hello
 
print("Hello", "World!")    # 中间一个空格分隔
 
print("多行语句 
      分割")
 
print("换行 
  符")        # 换行符
 
print("第一列	第二列")
 
print("不换", end="")
print("")
 
print("a={},b={}".format(1, 2))     # a=1, b=2
print("a=%s,b=%s" % (1, 2))
 
input = int(input("请输入喜欢的数字:"))
print("输出:", input)

运行结果:

Hello World!
hellohellohello
Hello World!
多行语句       分割
换行 
  符
第一列    第二列
不换行
a=1,b=2
a=1,b=2
请输入喜欢的数字:3
输出: 3
原文地址:https://www.cnblogs.com/jumpkin1122/p/11503143.html