+ -
当前位置:首页 → 问答吧 → for循环 break的问题

for循环 break的问题

时间:2011-11-21

来源:互联网

[code=Python][/code]
  for record_new in listnew:
  for record_old in listold:
  if record_old[4]==record_new[4]:
  if record_old[-2]<record_new[-2]:
  record_new[-2]=record_old[-2]
  break

  for record_new in listnew:
  for record_old in listold:
  if record_old[4]==record_new[4]:
  if record_old[-2]<record_new[-2]:
  record_new[-2]=record_old[-2]
  break
为什么前一种没有任何效果

作者: jiaweiqq123   发布时间: 2011-11-21

发完了代码自己看下。

作者: iambic   发布时间: 2011-11-21

怎么看,两个代码怎么都是一样的?

作者: userguanguan   发布时间: 2011-11-21

引用 1 楼 iambic 的回复:

发完了代码自己看下。
对不起,缩进没写好!!! 但是问题我自己解决了 谢谢您了

作者: jiaweiqq123   发布时间: 2011-11-21