题解 | #统计字符#
统计字符
https://www.nowcoder.com/practice/539054b4c33b4776bc350155f7abd8f5
my_str = input()
letter_count = 0
number_count = 0
space_count = 0
other_count = 0
for char in my_str.strip():
if char.isalpha():
letter_count += 1
elif char.isnumeric():
number_count += 1
elif char.isspace():
space_count += 1
else:
other_count += 1
print(letter_count)
print(space_count)
print(number_count)
print(other_count)
SHEIN公司福利 995人发布