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

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 
主站蜘蛛池模板: 白朗县| 格尔木市| 西峡县| 行唐县| 华阴市| 宁津县| 安国市| 湖口县| 历史| 齐河县| 青川县| 孝义市| 常德市| 金秀| 晋中市| 洪泽县| 荣昌县| 枣强县| 金堂县| 台江县| 石渠县| 玉门市| 日喀则市| 嘉义市| 三台县| 滨州市| 砀山县| 海安县| 焉耆| 泌阳县| 新野县| 健康| 屏边| 宜兴市| 扶风县| 于都县| 天祝| 镇远县| 西青区| 雅安市| 灵丘县|