Nov-02-2020, 01:48 PM
Thanks !
In fact I want to find value 64 (from 64%) with my split
In fact I want to find value 64 (from 64%) with my split
(Nov-02-2020, 01:41 PM)perfringo Wrote: With information provided I don't see how it can be 'working'.
>>> reason = 'test STATE (64/100)(64%) test1 test2.....' >>> reason.split(' ')[3] 'test1'
Next split on this string would be on(
which is not present, so there will be no split and as Python will be looking for item with indice 2 it will raise IndexError.
>>> _.split('(') ['test1']