str_1 ="123"str_2 ="Abc"str_3 ="123Abc"#用isdigit函数判断是否数字print(str_1.isdigit()) Tureprint(str_2.isdigit())Falseprint(str_3.isdigit())False#用isalpha判断是否字母print(str_1.isalpha())Falseprint(str_2.isalpha()) Tureprint(str_3.isalpha())False#isalnum判断是否数字和字母的组合...
str_1 ="123"str_2 ="Abc"str_3 ="123Abc"#用isdigit函数判断是否数字print(str_1.isdigit()) Tureprint(str_2.isdigit())Falseprint(str_3.isdigit())False#用isalpha判断是否字母print(str_1.isalpha())Falseprint(str_2.isalpha()) Tureprint(str_3.isalpha())False#isalnum判断是否数字和字母的组合...