最新回答 / 慕斯卡0574399
代码运行时是按照顺序来运行的。sum=0x=1while x<100: x=x+2 sum=sum+xprint sum首先运行第四行 运行第五行的时候 x 此时的值是 3 sum=sum+x x=x+2交换后 先运行 sum = sum+x 此时 x 值为 1
2018-10-14
已采纳回答 / 大白的弟弟小白
import mathimport turtledef square(t, length): """Draws a square with sides of the given length. Returns the Turtle to the starting position and location. """ for i in range(4): t.fd(length) t.lt(90)def polyline(t, n, length, ang...
2018-10-14
最新回答 / 茉莉_青花
我理解了过程,而逻辑是定死的,我们以三个为例子,为了完成第一轮,那么move(n-1, b, a, c)就必须是完成比一轮的B-->C,后面在执行,就要看move(n-1, b, a, c)是否能完成下一段的执行条件,如果不能就改位置,而这个刚好能完成。
2018-10-13