Log in from a computer to take this course

You'll need to log in from a computer to start Learn Python 2. But you can practice or keep up your coding streak with the Codecademy Go app. Download the app to get started.

apple storegoogle store
Learn

We’re getting pretty close to a playable board, but wouldn’t it be nice to get rid of those quote marks and commas? We’re storing our data as a list, but the player doesn’t need to know that!

letters = ['a', 'b', 'c', 'd'] print " ".join(letters) print "---".join(letters)
  1. In the example above, we create a list called letters.
  2. Then, we print a b c d. The .join method uses the string to combine the items in the list.
  3. Finally, we print a---b---c---d. We are calling the .join function on the "---" string.

We want to turn each row into "O O O O O".

Instructions

1.

Inside your function, inside your for loop, use " " as the separator to .join the elements of each row.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?