1、控制結構
(1)條件語句
if(條件) 表達式1 else 表達式2
(2)循環(loops)
for :for(變量 in 變量) 表達式
while while(條件)表達式
repeat repeat 表達式
三者略有區別:若知道終止條件(循環次數)就用for循環,若無法知道運行次數,則用while和repeat循環,repeat循環利用循環體的break語句跳出循環