elz: (ada-tubes)
elz ([personal profile] elz) wrote in [community profile] intro_to_cs2009-11-16 09:41 pm
Entry tags:

Problem Set 2

Post and discuss your answers in the comments! (And yay for everybody who posted problem set 1 answers!)
bellerina: (Default)

[personal profile] bellerina 2009-11-23 03:21 am (UTC)(link)
Does anyone know if there is a limit to how many indentations/levels of nested loops is viable in Python? I'm having an issue with problem 3 in that my nested loops work fine until I add another while loop outside of them, and I can't figure out why.
gchick: Small furry animal wearing a tin-foil hat (Default)

[personal profile] gchick 2009-11-23 04:14 am (UTC)(link)
There's no limit. Maybe if you posted a code snippet, someone might be able to spot something that you're not seeing?

(edit: on further research, I'm seeing a couple of references to limits between 20 and several hundred layers of indentation -- I'm not sure if the varying numbers are different versions or implementations or what, but even if it's 20, it's *way* more than anything you'd find in these problem sets, and possibly any sane software design.)
Edited 2009-11-23 04:30 (UTC)