2024-05-08 06:27:51 发布
网友
我有下面的代码,其中第二个if循环应该只在第一个条件满足后执行,有没有办法将这些循环组合到if循环?你知道吗
if Pline=mPL: if bestTime == None or bestTime < lastTime: bestTime = lastTime Time=(bestTime.strftime('%m-%d-%Y')) bestLocation = lastLocation
您需要and条件:
and
if (Pline=mPL) and ((bestTime == None) or (bestTime < lastTime)): bestTime = lastTime Time=(bestTime.strftime('%m-%d-%Y')) bestLocation = lastLocation
您需要
and
条件:相关问题 更多 >
编程相关推荐