| 
 | 
 
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册  
 
x
 
countA=0 
countB=0 
countC=0 
length=len(str1) 
for i in range(length): 
    if str1[i] == '/n': 
        continue 
    #判断大写字母 
    if str1[i].isupper(): 
        if countB: 
            countC+=1 
        else: 
            countC=0 
            countA+=1 
    #判断小写字母 
    if str1[i].islower(): 
        if countA!=3: 
            countA=0 
            countB=0 
            countC=0 
        else: 
            if countB: 
                countA=0 
                countB=0 
                countC=0 
            else: 
                countB=1 
                countC=0 
                tangle=i 
    #打印 
    if countA==3 and countC==3: 
        if i+1!=length and str1[i+1].isupper():#i+1!=length不理解 
            countB=0 
            countC=0 
        else: 
            print(str1[tangle],end='') 
            countB=0 
            countC=0
 
先判断是否即将超出索引,然后判断下一个字符是否为大写字符 
 
 
 
 |   
 
 
 
 |