O'Reilly logo

Swift Programming: The Big Nerd Ranch Guide by John Gallagher, Matthew Mathias

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Gold Challenge

Repeat the silver challenge, but this time make sure that the formatting above matches what you print to the console. You may need to search the documentation for how to represent special characters in String literals (e.g., how do you represent a newline in a String?). You will also want to look at the documentation for the print() function to use a new parameter called terminator. This parameter defaults to printing a new line after each String logged to the console, but you will want to do something else.

There are many ways to solve this challenge, but one way would be to print a String with a certain number of empty spaces (it is up to you to figure out how many!) when you print specific zip codes.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required