Mar-12-2017, 10:42 AM
(This post was last modified: Mar-12-2017, 10:42 AM by ichabod801.)
(Mar-12-2017, 04:43 AM)Skaperen Wrote: it had been my understanding that print() would apply repr() to any non-string argument it got.
It does. The error happens before that point. First it evaluates the argument it gets, then it applies repr. The error comes in the evaluation, when
+ listA[i]
tries to add an integer to a string.Edit: Didn't think it through. print applies str() to any non-string argument it gets. Typing an argument into the interactive console gives the repr().
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures