If语句
if语句是分支流程控制的一种方法:
- let name = readLine(stdin)
- if name == "":
- echo "Poor soul, you lost your name?"
- elif name == "name":
- echo "Very funny, your name is name."
- else:
- echo "Hi, ", name, "!"
可以没有或多个 elif ,并且 else 是可选的, elif 关键字是 else if 的简写,并且避免过度缩进。( "" 是空字符串,不包含字符。)