Python字符串內建函数实现了string模块的大部分方法,并包括了对Unicode编码方式的支持. (1)capitalize(): 将字符串的第一个字母变成大写,其他字母变小写.对于 8 位字节编码需要根据本地环境. >>> str='I AM MenAngel!'+'I am Student!' >>> print(str) I AM MenAngel!I am Student! >>> str.capitalize() 'I…
abs(number) 絕對值 The abs() method takes a single argument: num - number whose absolute value is to be returned. The number can be: integer floating number complex number any(iterable) The any() method returns True if any element of an iterable is…