hi! i'm going thru the lecture py files for lecture 2: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/unit-1/lecture-2-core-elements-of-a-program/lec02.py and if you run lines 21-51 with values: x = 5, y = 4, z = 3, the first loop (line 28-34) returns "y is least". am i taking crazy pills? the other 2 if loops return z which is correct. thanks for any help!
You're mostly correct, except that it's not a loop. It is definitely a demonstration of a flawed assumption though, as it only evaluates the z condition when x is less than y.
awesome, thanks for verifying!
No problem; it was a good catch; I haven't gone through that video in a while so I can't remember if the flaw was covered in the lecture or not, but it's awesome that you're actually going through the code and questioning it to understand it instead of just assuming that everything can be taken at face value.
Join our real-time social learning platform and learn together with your friends!