The return object is named None
for list.reverse()
. So this code fails when I call solution(k)
. Is there any way I can get around making a temporary? Or how should I do it?
fCamel = 'F'
bCamel = 'B'
gap = ' '
k = ['F', ' ', 'B', 'F']
def solution(formation):
return ((formation.index(bCamel) > (len(formation) - 1 - (formation.reverse()).index(fCamel))))
p.s. This is my first code in python. I thought it was functional.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…