我似乎没有发现有人问这个问题,但如果它已经在那里,那么我道歉,并将感谢链接。你知道吗
为了这个问题。 当前正在使用此列表:
nouns = ['house','bee','ducks','blouse','cars']
我想做一个程序,把复数的单词改成单数,单数的单词改成复数。我打算尝试使用索引号来更改列表,例如:
for index, word in enumerate(nouns):
if word[-1] is 'e':
print nouns[index]==word[-1]+'s'
print nouns
我对Python还是很陌生,但现在已经卡住了。任何帮助或暗示都将不胜感激。你知道吗
请注意,这适用于您提供的特定列表,但由于
men
等复数形式,因此不能授予其他单词集合这个怎么样
相关问题 更多 >
编程相关推荐