我正在尝试查找单词列表中的字符总数,特别是此列表:
words = ["alpha","omega","up","down","over","under","purple","red","blue","green"]
Run Code Online (Sandbox Code Playgroud)
我试过做:
print "The size of the words in words[] is %d." % len(words)
Run Code Online (Sandbox Code Playgroud)
但这只是告诉我列表中有多少单词,即10.
任何帮助,将不胜感激!
对不起,我想提一下,我正在做的这个类是关于for循环的主题,所以我想知道我是否必须实现一个forloop来给我一个答案,这就是for循环标签的原因.