Common Python string determination function

Analyzing string common functions:

S represents a string

S.isalnum () All characters are numbers or letters, is true returns Ture, False otherwise

S.isalha () All characters are letters, is true returns Ture, False otherwise

S.isdigit () All characters are numeric, true return Ture, False otherwise

S.islower () are all lowercase characters, true return Ture, False otherwise

S.isupper () All characters are uppercase, true return Ture, False otherwise

S.istitle () all words are capitalized, is true returns Ture, False otherwise

S.isspace () all characters are blank characters, true return Ture, False otherwise

 

Using int () can be converted to decimal integer, the result is rounded down.

Using int () rounding rounded off in accordance with:

1, the result is rounded 5: int (5.4 + 0.5) == 5

2, rounded result of 6: int (5.6 + 0.5) == 6

Guess you like

Origin www.cnblogs.com/smilelin/p/11488756.html