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.