|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- str1 = '''ABSaDKSbRIHcRHGcdDIF'''
- countA = 0
- countB = 0
- countC = 0
- length = len(str1)
- for i in range(length):
- if str1[i] == '\n':
- continue
- if str1[1].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
- target = i
- if countA == 3 and countC == 3:
- if i+1 != length and str1[i+1].isupper():
- countB = 0
- countC = 0
- else:
- print(str1[target],end='')
- countA = 3
- countB = 0
- countC = 0
复制代码
1,你的print写在了else里面,肯定打印不出来啦
2,如果读取到换行就怎么样
|
|