[Tutor] Building Starships -- object of type 'int' has no len()

Marc Tompkins marc.tompkins at gmail.com
Mon Aug 18 09:36:37 CEST 2014


On Sun, Aug 17, 2014 at 10:51 PM, Terry--gmail <terry.kemmerer at gmail.com> wrote:
> I'm copy and pasting from Ninja-IDE, which I thought was created
> specifically to do python programming...

Specifically for programming, yes, and Python is among the supported
languages - but according to their web page, they support many
languages (and in many other languages, whitespace is either not
meaningful, or else you might actually want the Tab key to produce a
tab character.)
Anyway, I'm only guessing that the reason your indentation was
disappearing was a tab/space issue; I don't actually know.

>
> for line_number, row in enumerate(catalog2):
>     for col, item in enumerate(row):
>         if lens[col] < len(item):
>         lens[col] = len(item)
>
> How's that?

Perfect.


More information about the Tutor mailing list