Deviopath › Swift

Parse an Age

Medium · Error Handling

Int(text) returns Int?. If the text is not an integer, or the number is outside 0...130, return "invalid age". Otherwise return the number as a string.

Write parseAge(_:).

Next: Rectangle Methods