Fundamentals7 / 8
Up next

switch

let score = 82
// switch must be exhaustive; ranges and where clauses are allowed
switch score {
case 90...100:
    print("A")
case 80..<90:
    print("B")
case let s where s < 0:
    print("invalid")
default:
    print("C or lower")
}
What you're solving

exhaustive matching with where and ranges