Skip to content

Latest commit

 

History

History

176_Create_a_variable_length_chessboard

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Bite 176. Create a variable length chessboard

## Description

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!