题解 | #字符个数统计#
字符个数统计
https://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50
a = list(input()) al = [] count = 0 for i in a: if i not in al: al.append(i) count += 1 print (count)
这题学到,输入的时候直接使用 list(input())直接把一个字符串分成按单个字母产生的数组
字符个数统计
https://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50
a = list(input()) al = [] count = 0 for i in a: if i not in al: al.append(i) count += 1 print (count)
这题学到,输入的时候直接使用 list(input())直接把一个字符串分成按单个字母产生的数组
相关推荐