我想创建一个函数来检查字符串的第一个字母是否为大写.这是我到目前为止所提出的:
def is_lowercase(word):
if word[0] in range string.ascii_lowercase:
return True
else:
return False
Run Code Online (Sandbox Code Playgroud)
当我尝试运行它时,我收到此错误:
if word[0] in range string.ascii_lowercase
^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)
有人可以看一看并告知我做错了什么吗?
python ×1