其他方法:
使用正则的话
import re time2 = '26September2018' month = re.search('(\d+)(\w+?)(\d+)',time2).group(2) year = re.search('(\d+)(\w+?)(\d+)',time2).group(3) day = re.search('(\d+)(\w+?)(\d+)',time2).group(1) print(month) print(year) print(day)