Can anyone help me why my python code for this "Compare Version Numbers" problem returns a typeerror " 'unicode' object is not callable" in 29th line? Thank you!

```
class Solution(object):
def compareVersion(self, version1, version2):
"""
:type version1: str
:type version2: str
:rtype: int
"""
while version1 and version2:
v1 = self.digits(version1)
v2 = self.digits(version2)
if v1 > v2:
return 1
elif v1 < v2:
return -1
else:
version1 = self.cut(version1)
version2 = self.cut(version2)
if version1 == "" and version2:
return -1
elif version1 and version2 == "":
return 1
else:
return 0
def digits(self, version):
for i in range(len(version)):
if version(i) != '.':
i += 1
else:
return int(version[:i])
return int(version)
def cut(self, version):
for i in range(len(version)):
if version(i) != '.':
i += 1
else:
return version[(i+1):len(version)]
return ""
```