def lis(strs):
    upper = string.ascii_uppercase
lower = string.ascii_lowercase
if strs[0] in upper:
    return list(upper[upper.index(strs[0]):upper.index(strs[-1]) + 1])
if strs[0] in lower:
    return list(lower[lower.index(strs[0]):lower.index(strs[-1]) + 1])
print(lis('a-d'))
print(lis('B-F'))
Expand alphabetical range to list of characters in Python