当需要迭代大量整数时,xrange方法更适用,因为它不会创建极大的list,那样会消耗大量计算机内存。
The xrange method is preferred when you need to iterate over a large number of integers because it won't create the full list, which could consume a large quantity of your computer's memory.
在我的桌面计算机上,一百万次迭代需要大约 12 秒钟才能完成。
On my desktop machine, one million iterations takes about 12 seconds to complete. The pooling code avoids the allocation of the MyClass object within the loop
采用迭代方法和编制的VB - 5计算机程序进行了计算,并绘制了倾斜地层中井眼围岩发生剪切滑移破坏典型的关系曲线。
The iterative method and VB-5 computer program are applied to solve the equations, and the typical relationship curves about shear slip failure of the rock around borehole are drawn out.
应用推荐