python中print輸出格式有:1、可用加號連接【print("I " "love " "you")】;2、逗號連接會自動在連接字串之間加上空格【print ("I","love","you")】;3、也可直接連接。
python中print輸出格式有:
Python中""與''是完全一樣的print( "Hello World!")
# 直接列印字串
print('Hello World!')
# 對於python,單一引號也可表示字串
#rree## ## #有別於C 等強型別name = 'Tom'
year = 2018
print(year)
print(name) print("Hello " + name)
print("I " + "love " + "you")
print("I","love","you")
print("I ""love ""you")
print( "Hello {0}".format(name) )
print( "I am %s, today is %d year"%(name, year) )
for i in range(0,5):
python教程
以上是python中print輸出格式有哪些的詳細內容。更多資訊請關注PHP中文網其他相關文章!