On Thu, Dec 13, 2018 at 11:07:59PM -0500, Avi Gross wrote: [...] > There are cases where it may make sense to have a long like connected by AND > or OR given how python does short-circuiting while returning the last thing > or two it touched instead of an actual True/False. For example, you may want > to take the first available queue that is not empty with something like > this: > > Using = A or B or C or ... or Z > Handling = Using.pop() > > Sure, that could be rewritten into multiple lines.
using = (A or B or C or D or E or F) [...] > I recently wrote some code and ran into error messages on lines I was trying > to keep short: > > A = 'text" > A += "more text" > A += object > A+= ... Without knowing the error message, its impossible to say what the problem is. My guess is that the object on line three wasn't a string. In which case, the obvious fix is: A += str(object) -- Steve _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor