【发布时间】:2021-01-31 14:05:04
【问题描述】:
好吧,我试图在 python 中为等图编写代码作为我的任务,所以我被困在这里
我考虑过以下事情
1.所有输入的字都是小号
2. 只包含字母,没有特殊字符或数字
word =input("enter the word ")
list_of_alphabets = list(word)
no_of_alphabets = len(list_of_alphabets)
for i in range(no_of_alphabets):
number = list_of_alphabets.count()
print (number)
我现在卡在这里了,我希望 for 循环检查每个字母是否出现一次,并打印每个字母出现的次数。如果不是,那么它应该打印 not an isogram ,如果是则打印 isogram 。另外,如果此代码有其他方法,我也希望
PS。请不要向我推荐 geeksforgeek 的代码,因为我已经看过了
【问题讨论】:
标签: python python-3.x list