[Tutor] int uncallable
kent37 at tds.net
Mon Jul 18 22:10:59 CEST 2005
cgw501 at york.ac.uk wrote:
> This code:
> for line in satFile:
> lineListed = line.split()
> start = int(lineListed)-1
> end = int(lineListed)
> hitLength = end - start
> extra = len(lineListed)
> total = hitLength + 2(extra)
You are trying to call 2 as a function - 2(extra). You can't do that. Maybe you mean 2*(extra) ??
> gives an error:
> Traceback (most recent call last):
> File "test2.py", line 29, in ?
> total = hitLength+ 2(extra)
> TypeError: 'int' object is not callable
> which confuses me. Why can't I call extra? Have I not called int objects
> when I define hitLength, and that works fine.
> Tutor maillist - Tutor at python.org
More information about the Tutor