I am trying to use not more pythonic style to code my for-loop and if statement. Most of the time it works fine but this time with else-statement it returns me error message. Is there any grammar error in my code? How can I change it?
point_listSim = [(p.split('Reporting/'))[1] for p in point_list if 'Reporting/' in p else (p.split('reporting/'))[1]]