返回列表 發帖

變數宣告與基本輸出 (一)

本帖最後由 tonyh 於 2022-3-5 12:14 編輯

  1. a=123
  2. b=456
  3. print(a,"python",b)
  4. print(a,"python",b,sep="~")
  5. print(a,"python",b,sep="~",end="!!!\n")
  6. print(str(a)+"~python~"+str(b)+"!!!")
複製代碼
Spyder 環境下常用快捷建

Ctrl+1    單行註解  
Tab    簡易智慧輸入 (輸入部分文字後按 Tab 鍵)
Ctrl+Alt+向下方向鍵    向下做單行複製
Ctrl+D    刪除單行
Ctrl+Z    回到上一步
F5    執行程式

  1. a=123
  2. b=456
  3. print(a,"python",b)
  4. print(a,"python",b,sep="~")
  5. print(a,"python",b,sep="~",end="!!!\n")
  6. print(str(a)+"~python~",str(b))
複製代碼

TOP

  1. a=123
  2. b=456
  3. print(a,"python",b)
  4. print(a,"python",b,sep="~")
  5. print(a,"python",b,sep="~",end="!!!\n")
  6. print(str(a)+"~python~"+str(b),end="!!!")
複製代碼

TOP

  1. print('  /|')
  2. print(' / |')
  3. print('/ _|')
  4. #
  5. name = "小名"
  6. age = 22
  7. ismale=True
  8. print('我是'+str(name)+',今年'+str(age)+'歲')
  9. print(str(name)+'是男生?'+str(ismale))
  10. #
  11. print('word\nHello\"')
  12. #
  13. pharse = "jfelwf"
  14. print(pharse.lower())
  15. print(pharse.upper())
  16. print(pharse.isupper())
  17. print(pharse.islower())
  18. print(pharse[4])
  19. print(pharse.index("e"))
  20. print(pharse.replace('f','u'))
  21. print(3E5)
  22. print(type(pharse))
  23. print(int(10.3534))
  24. print("s"*7)
  25. #
  26. print('今天天氣晴','我要吃蛋餅',sep='~',end='.')
  27. print('為甚麼要吃蛋餅')
複製代碼

TOP

返回列表