官术网_书友最值得收藏!

The continue statement

What should you do when you want to skip one (or more) loop repetitions then, nevertheless, continue with the next loop iteration? For this, you need continue, as in this example:

for n in 1:10  
  if 3 <= n <= 6 
    continue # skip current iteration 
  end 
  println(n) 
end 

This prints out, 1 2 7 8 9 10, skipping the numbers three to six, using a chained comparison.

There is no repeat...until or do...while construct in Julia. A do...while loop can be simulated as follows:

while true 
# code 
  condition || break 
end 
主站蜘蛛池模板: 辰溪县| 沅江市| 江西省| 乐平市| 武功县| 鄢陵县| 大同县| 旺苍县| 通辽市| 昌乐县| 达尔| 阿拉善左旗| 辽阳市| 建平县| 布拖县| 大安市| 汝州市| 田东县| 温宿县| 玛沁县| 阿坝| 襄垣县| 新和县| 深水埗区| 鄂尔多斯市| 长葛市| 通化县| 新昌县| 广南县| 临澧县| 武城县| 德保县| 宜丰县| 武乡县| 霍城县| 普格县| 佳木斯市| 莱芜市| 霸州市| 淳化县| 婺源县|