这是我的编码:
def cookie_cook2(cook):
""" cookie_cook2 takes a string `cook` and returns a string containing a grammatically correct and important question about the cook """
# code here.
if cook[0].lower()=="a" or cook[0].lower()=="e" or cook[0].lower()=="i" or cook[0].lower()=="o" or cook[0].lower()=="u":
return 'How many cookies could an '+ cook + ' cook if a good cook could cook cookies'
else:
return 'How many cookies could a ' +cook+ ' cook if a good cook could cook cookies'
但是如何我输入>>> print(cookie_cook2(""))
它产生额结果不是How many cookies could a cook if a good cook could cook cookies 而是Your submission raised an exception of type IndexError
.