条件判断
与许多编程语言一样,Soulver 支持条件判断(有时称为“if 语句”)。
earnings = $45k | $45,000.00
if earnings > $30k then tax = 20% else tax = 5% | 20%
My tax paid: earnings × tax | $9,000.00income = $35k
expenses = $21.5k
profitable = true if income > expenses | true
insolvent = false unless expenses > income | falseBMI = 24
Underweight = BMI < 18.5 | false
Healthy Weight = BMI >= 18.5 and BMI < 25 | true
Overweight = BMI >= 25 and BMI < 30 | false
Obese = BMI >= 30 | false比较运算符和布尔值
名称
运算符
最后更新于