本帖最后由 821115845 于 2019-11-2 19:36 编辑
能不能继续请教你一下,经过你的回答这个我还是看不懂,我就自己重新用粗暴的方法解了小甲鱼老师的这个题目你看一下str1 = '''ABSaDKSbRIHcRHGcdDIF'''
str2 = 'a'+ str1 +'a'
length = len(str1)
length2 = length - 4
count = 3
for i in range(count,length2):
if (str2[i] == '\n' or str2[i-1] == '\n' or str2[i-2] == '\n' or str2[i-3] == '\n' or
str2[i+1] == '\n' or str2[i+2] == '\n' or str2[i+3] == '\n'):
continue
if (not str2[i-4].isupper() and str2[i-3].isupper() and str2[i-2].isupper() and str2[i-1].isupper()
and str2[i].islower() and str2[i+1].isupper() and str2[i+2].isupper()
and str2[i+3].isupper() and not str2[i+4].isupper()):
print(str2[i],end ='')
还是说必须要看得懂小甲鱼老师的那个解法![](static/image/smiley/lovely/20080925104600355.gif) ![](static/image/smiley/lovely/20080925104600355.gif) ![](static/image/smiley/lovely/20080925104600355.gif) |