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

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 
主站蜘蛛池模板: 进贤县| 合阳县| 图木舒克市| 买车| 浮山县| 湖北省| 阳泉市| 安图县| 兰考县| 马龙县| 衡水市| 北宁市| 大冶市| 沅江市| 合川市| 蒲江县| 屏山县| 自治县| 得荣县| 福建省| 潍坊市| 崇左市| 英吉沙县| 寿阳县| 甘肃省| 桂东县| 方城县| 同江市| 搜索| 噶尔县| 江口县| 年辖:市辖区| 黄骅市| 虹口区| 广宁县| 靖江市| 哈巴河县| 合作市| 松潘县| 池州市| 阳高县|