Code style query: multiple assignments in if/elif tree

Ian Kelly ian.g.kelly at gmail.com
Tue Apr 1 04:29:42 EDT 2014


On Tue, Apr 1, 2014 at 1:59 AM, Ian Kelly <ian.g.kelly at gmail.com> wrote:
> Given that, I have to question your figures:
>
>> 177.211111333333
>
>> compared to 177.26527800000002 calculated the rough way. That's not bad,
>> only about 5cm off! Effectively, your rough calculation was accurate to
>> one decimal place.
>
> As I noted the rough way should be an underestimate, so I'm not sure
> why it's an overestimate here.  That said, I don't see where either of
> us made a mistake.

And I realize now that this is also because the linear deceleration
assumption doesn't match the average deceleration stated in the
problem.  It actually decelerates faster and cuts under the t=1s and
t=2s points in the velocity graph, and therefore is actually a
slightly larger underestimate.



More information about the Python-list mailing list