方思涵w3schools字串str, format, slicing[::]
w3school練習
#方思涵 練習
b="apple"
print('字串長度' + str(len(b)))
print(b[::-1])
quantity = "巧克力"
itemno = 3
price = "我"
myorder = "他要吃 {} 吃{}個 ,和 {} 一起吃"
print(myorder.format(quantity, itemno, price))
#方思涵 練習
b="apple"
print('字串長度' + str(len(b)))
print(b[::-1])
quantity = "巧克力"
itemno = 3
price = "我"
myorder = "他要吃 {} 吃{}個 ,和 {} 一起吃"
print(myorder.format(quantity, itemno, price))
留言
張貼留言