随机化列表

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了随机化列表相关的知识,希望对你有一定的参考价值。

  1. if out_of_order_events:
  2. randomized_logfile_lines = []
  3. while len(logfile_lines):
  4. randomized_logfile_lines.append(logfile_lines.pop(random.randrange(0,len(logfile_lines))))
  5. logfile_lines = randomized_logfile_lines

以上是关于随机化列表的主要内容,如果未能解决你的问题,请参考以下文章