GH avatar Bite 176. Create a variable length chessboard

In this Bite you are going to print a chessboard to stdout (use print).

Complete create_chessboard that takes an optional argument size which sets the dimensions of the board (or grid).

This is how it should work:

>>> from chessboard import create_chessboard
>>> create_chessboard(2)
 #
#

>>> create_chessboard(4)
 # #
# #
 # #
# #

>>> create_chessboard(8)
 # # # #
# # # #
 # # # #
# # # #
 # # # #
# # # #
 # # # #
# # # #

Credit to the awesome Eloquent JS book where we got this exercise from (why not try it in JS too?!). Regardless, keep calm and code more Python!

go back Beginner level
Bitecoin 2X

96 out of 97 users completed this Bite.
Will you be Pythonista #97 to crack this Bite?
Resolution time: ~27 min. (avg. submissions of 5-240 min.)
Pythonistas rate this Bite 2.0 on a 1-10 difficulty scale.
» You can do it! 😌

Buy Now Login and get coding
We use Python 3.7