print(str_1.isdigit())
print(str_1.isalpha())
print(str_1.isalnum())
import string punc = string.punctuation if str_1 in punc: print('is punctuation')
搜索
复制