print 默認(rèn)輸出是換行的,如果要實(shí)現(xiàn)不換行需要在變量末尾加上 end="":
student_age = 18
print("學(xué)生的年齡為:", student_age)
# print("學(xué)生的年齡為:"),print(student_age)中間不換行
# print執(zhí)行完后默認(rèn)換行
print("hello,world!",end="\n")
print("hello,world!",end="") # 不換行
print("hello,world!",end="")

print("Abby","Candy","Tina","Sandy",sep="==")
sep 分隔符

如:
money = 121
print("本次消費(fèi)金額為:", money, sep="$")
print還可以把內(nèi)容輸出到文件
str01 = "本次消費(fèi)金額為:$128"
file01 = open("d:\sales.txt","w")
print(str01,file = file01) #文件輸出會(huì)有異常,需要異常處理
學(xué)習(xí)視頻:
http://www.ilync.cn/kecheng/detail_1452350?f=org_coursecenter
課程持續(xù)更新中;
繼續(xù)加油;
有很多伙伴一起前行;
你從不孤單!