在我的一个程序中,我怀疑我是否正确使用了比较.我想在做某事之前确保(u0 <= u <u0 +步骤).
if not (u0 <= u) and (u < u0+step):
u0 = u0+ step # change the condition until it is satisfied
else:
do something. # condition is satisfied
Run Code Online (Sandbox Code Playgroud) python ×1