题解 | #字符个数统计#
字符个数统计
https://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50
import sys input_data = sys.stdin.read().strip() def count_unique_characters(s): uni_str = set() for i in s: asc_code = ord(i) if 0 < asc_code < 127: uni_str.add(i) return len(uni_str) result = count_unique_characters(input_data) print(result)