I get " Line 8: IndexError: string index out of range" when submitting,but this code works just fine on my pc.

Last input is 1,5.

```
def fractionToDecimal(numerator, denominator):
if(numerator%denominator==0):
return str(numerator//denominator)
ans = str(numerator/denominator)
subs = ans[2:]
if len(subs) == subs.count(subs[0]) and len(subs)>3:
return ans[:2] + "(" + subs[0] + ")"
return ans
```

You can find my submission here: https://oj.leetcode.com/submissions/detail/17196047/

Can you help me understand why I get the error?

As I said this code works just fine when I run it on my pc using Python 3.4.2