🔀
课程 3
Conditions and loops: the brain
📖 课程
──▶
🎯 测验——选择翻译
──▶
✅ 本课已完成
If it rains — take an umbrella: that is if. Do exercise every morning — that is a loop. Every program is built from these two bricks.
- ●if age >= 18: grant access
- ●while tired: keep sleeping
- ●for day in week: check inbox
🔀
if—如果条件
🔁
while—只要为真
🔂
for—对每个元素
⛔
break—停止循环
↩️
return—返回结果
➡️
else—否则