txt = "劉任昌Love蘋果,蘋果我my favoritE水果蘋果"
print(txt.count("蘋果"))
print('先練習內建函數len',len(txt))
print('find',txt.find("蘋果"))
print('rfind',txt.rfind("蘋果"))
print("print列印,字串string字元character的組合")
print(txt.title())
print(txt.lower())
print(txt.upper())
print(txt.swapcase())
print(txt.zfill(32))
print(txt.startswith("任"))
print(len(txt))
for i in range(33333, 33344):
print(chr(i))
for i in range(65, 70):
print(chr(i))
Fills the string with a specified number of 0 values at the beginning
Method Description
capitalize() Converts the first character to upper case
casefold() Converts string into lower case
center() Returns a centered string
count() Returns the number of times a specified value occurs in a string
encode() Returns an encoded version of the string
endswith() Returns true if the string ends with the specified value
expandtabs() Sets the tab size of the string
find() Searches the string for a specified value and returns the position of where it was found
format() Formats specified values in a string
format_map() Formats specified values in a string
index() Searches the string for a specified value and returns the position of where it was found
isalnum() Returns True if all characters in the string are alphanumeric
isalpha() Returns True if all characters in the string are in the alphabet
isascii() Returns True if all characters in the string are ascii characters
isdecimal() Returns True if all characters in the string are decimals
isdigit() Returns True if all characters in the string are digits
isidentifier() Returns True if the string is an identifier
islower() Returns True if all characters in the string are lower case
isnumeric() Returns True if all characters in the string are numeric
isprintable() Returns True if all characters in the string are printable
isspace() Returns True if all characters in the string are whitespaces
istitle() Returns True if the string follows the rules of a title
isupper() Returns True if all characters in the string are upper case
join() Converts the elements of an iterable into a string
ljust() Returns a left justified version of the string
lower() Converts a string into lower case
lstrip() Returns a left trim version of the string
maketrans() Returns a translation table to be used in translations
partition() Returns a tuple where the string is parted into three parts
replace() Returns a string where a specified value is replaced with a specified value
rfind() Searches the string for a specified value and returns the last position of where it was found
rindex() Searches the string for a specified value and returns the last position of where it was found
rjust() Returns a right justified version of the string
rpartition() Returns a tuple where the string is parted into three parts
rsplit() Splits the string at the specified separator, and returns a list
rstrip() Returns a right trim version of the string
split() Splits the string at the specified separator, and returns a list
splitlines() Splits the string at line breaks and returns a list
startswith() Returns true if the string starts with the specified value
strip() Returns a trimmed version of the string
swapcase() Swaps cases, lower case becomes upper case and vice versa
title() Converts the first character of each word to upper case
translate() Returns a translated string
upper() Converts a string into upper case
zfill() Fills the string with a specified number of 0 values at the beginning
https://reurl.cc/VNgYXb
回覆刪除有使用vs code?
刪除https://wang-yu-jia-wangyujia.blogspot.com/2024/02/pythonstringmethods.html
回覆刪除沒有使用vscode? 截圖一定要原始大小!
刪除https://russellma2005525.blogspot.com/2024/02/pythonstringmethods.html
回覆刪除https://hank20050328.blogspot.com/2024/02/pythonstringmethods.html
回覆刪除動手做,很傑出!截圖小一點,才能看清楚。
刪除https://laiweikaiaaa.blogspot.com/2024/02/pythonstringmethods.html
回覆刪除截圖要清楚一點!自己做,很優秀!
刪除https://www.blogger.com/blog/post/edit/preview/4616311045112546689/7845862625363149320
回覆刪除h1要有大於、小於標記,一定要自己使用
刪除https://wuhongbing.blogspot.com/2024/02/pythonstring.html
回覆刪除自己做,就是優!要繼續改善截圖。
刪除https://naiyuanzhang1226.blogspot.com/2024/02/pythonstringmethods.html
回覆刪除截圖清晰,迴圈,補充,神優秀。
刪除https://chan-wan-yi.blogspot.com/2024/02/pythonstringmethods.html
回覆刪除https://kuoyiting.blogspot.com/2024/02/python-string-methods.html
回覆刪除https://shenzhenxuan.blogspot.com/2024/02/pythonstringmethods.html
回覆刪除https://su-you-an.blogspot.com/2024/02/pythonstringmethods.html
回覆刪除https://jhuang-huei.blogspot.com/2024/02/pythomstringmethods.html
回覆刪除https://linziwei0308.blogspot.com/2024/02/pythonstringmetods.html
回覆刪除https://www.blogger.com/blog/post/edit/preview/5779881926535543652/6577989269403138257
回覆刪除迴圈好!練習讓截圖清楚。
刪除https://yiingxxn.blogspot.com/2024/02/pythonstringmethods.html
回覆刪除截圖清晰!迴圈。盡量多寫,多從網路整理相關資訊,多累積知識,創造智慧。
刪除https://0209tongting.blogspot.com/2024/02/pythonstringmethods.html
回覆刪除https://www.blogger.com/blog/post/edit/preview/4393298692252949908/1666155943399848762
回覆刪除https://shirong046.blogspot.com/2024/02/pythonstring.html
回覆刪除https://stanley-ouo.blogspot.com/2024/02/pythonstringmethods.html
回覆刪除https://sandy06252023.blogspot.com/2024/02/pythonstringmethods.html
回覆刪除截圖清喜,迴圈,LEN,CHR.
刪除https://zhen-zhen4869.blogspot.com/2024/02/pythonstringmethods.html
回覆刪除使用迴圈字元函數chr.
刪除詳細補充,累積知識,醞釀智慧。
刪除https://wujiaqi1010.blogspot.com/2024/02/pythonstringmethods.html
回覆刪除有截圖vscode,就是優!
刪除https://caipeishan1223.blogspot.com/2024/02/pythonstringmethods.html
回覆刪除截圖很清楚!
刪除https://www.blogger.com/blog/post/edit/1248398302505076375/8238055741975894445
回覆刪除沒內容!
刪除https://wnagenqiiiiiiiiiiii.blogspot.com/2024/03/pythonstringmethods.html
回覆刪除妳回家做的嗎?很優秀!
刪除https://linchinppei.blogspot.com/2024/03/pythonstringmethods.html
回覆刪除妳家裡電腦有裝vs code?請告訴我真相,不要嚇唬我!
刪除https://zzl1102.blogspot.com/2024/03/pythonstringmethods.html
回覆刪除https://giinasmile.blogspot.com/2024/03/pythonstringmethods.html
回覆刪除https://yang0218.blogspot.com/2024/03/pythonstringmethods-2-29-2024-python.html
回覆刪除https://wenhuichenchen.blogspot.com/2024/03/pythonstringmethods.html
回覆刪除https://xu0625.blogspot.com/2024/03/pythonstringmethods.html
回覆刪除https://lukelu0928.blogspot.com/2024/03/pythonwriteaw.html
回覆刪除