Silver Challenge

The printTable(_:) function has a bug – it crashes if any of the data items are longer than the label of their column. Try changing Joe’s age to 1000 to see this in action. Fix the bug. (For an easier version of this challenge, just make the function not crash. For a harder version, make sure all the rows and columns of the table are still aligned correctly.)

Get Swift Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.