txt = "謝孜妤 love 蘋果, 蘋果 are my favorite fruit"
print( txt.count("蘋果"))
print( txt.find("蘋果"))
print('先練習內建函數len',len(txt))
print( txt.rfind("蘋果"))
txt = "50"
print(txt.zfill(10))
txt = "Hello my friends"
print(txt.upper())
txt = "Hello My Name Is PETER"
print(txt.swapcase())
txt = "Hello my FRIENDS"
print( txt.lower())
for i in range(33333,33344):
print(chr(i))
for i in range(65,100):
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
謝孜妤利用Javascript迴圈For輸出連續30個表情符號 輸出 in-line style selector線內樣式選擇 謝孜妤ASCII CODE美國資訊交換標準碼 一位元組BYTE由八位元BIT組成,為何是八位元?因為2的八次方等於256可以涵蓋打 字機的所有字元(字母) 顯示display字碼<,=>: < = > 顯示display字碼65 66: A B C 顯示display字碼97 98: A a b EMOJI是「繪文字」或「表情符號」。 表情符號看起來像圖像或圖標,但其實不然。 它們是 UTF-8 (Unicode萬國碼) 字元集中的字母(字元)。 Emojis look like images, or icons, but they are not. They are letters (characters) from the UTF-8 (Unicode) character set.
留言
張貼留言