Python Programming Exercises, Gently Explained
29
the bottom of your solution program. Your solution is correct if the following assert statements’
conditions are all True:
assert getChessSquareColor(1, 1) == 'white'
assert getChessSquareColor(2, 1) == 'black'
assert getChessSquareColor(1, 2) == 'black'
assert getChessSquareColor(8, 8) == 'white'
assert getChessSquareColor(0, 8) == ''
assert getChessSquareColor(2, 9) == ''
Try to write a solution based on the information in this description. If you still have trouble
solving this exercise, read the
Solution Design and
Special Cases and Gotchas sections for
additional hints.
Prerequisite concepts: Boolean operators, modulo operator
Dostları ilə paylaş: