#林姵語strings可以用單引雙引只要對稱
b = '狗吃屎,兔吃菜,貓抓鼠,林姵語很美'
# 0 1 23 4 5 678 9 10,11,12,
print('字串長度' + str(len(b)))
#len函數 字串長度 輸出 整數
#str函數 轉成字串 這樣才能串接
print(b[-5:-2])
#練習字串格式format
quantity = "精華下午茶"
itemno = 5
price = "林姵語"
myorder = "我要吃 {} 吃幾個 {},和 {} 誰一起吃"
print(myorder.format(quantity, itemno, price))
w3schools
台灣平均每人GDP的時間序列 w3schools範例:房屋面積與價格關係
留言
張貼留言