题解 | #蛇形矩阵#
统计字符
http://www.nowcoder.com/practice/539054b4c33b4776bc350155f7abd8f5
s = input() letter_count = 0 space_count = 0 number_count = 0 other_count = 0 for i in s: if i.isalpha(): letter_count += 1 elif i == " ": space_count += 1 elif i.isalnum(): number_count += 1 else: other_count += 1 print(letter_count) print(space_count) print(number_count) print(other_count)
正浩创新EcoFlow公司福利 704人发布
查看1道真题和解析