我想在数组列表中运行for循环并打印出任何带有"monkey"字样的内容.我在下面编写了以下代码,但它给了我一个错误.我不太确定我做错了什么.任何帮助都会很棒,谢谢.
a= "monkeybanana"
b= "monkeyape"
c= "apple"
list= [a, b, c]
print "The words that start with monkey are:"
for k in words:
if list.startswith('monkey'):
print list
Run Code Online (Sandbox Code Playgroud)