def words(string: str) -> list[str]:
return string.split(' ')
运行此代码会出现错误
TypeError: 'type' object is not subscriptable
我该如何正确指定输出结果将是一个字符串列表?
def words(string: str) -> list[str]:
return string.split(' ')
运行此代码会出现错误
TypeError: 'type' object is not subscriptable
我该如何正确指定输出结果将是一个字符串列表?