New answers tagged

3

Honestly, for the symbol, I'd just go with using uppercase characters (X and O) since the pieces don't really have any special functionality at this stage, and it's good to keep some simplicity with earlier projects. I'd put the win condition checking into the game class. If you want to reuse the board class in the future, it's a good idea for you to avoid ...


7

First, you should not be using Python 2 anymore, if at all possible. It will reach end of support at the end of the year. In Python 3 your code would just be: def all_eating_unicode_converter(input_string): """ Converts every input to unicode. :param input_string: may be a string or unicode or bytes. :return: returns unicode Tested ...


-1

The code should work fine once the issues mentioned by @alexwlchan are fixed, I added those changes and code looks like this: def peakfinder(arr): if len(arr) == 0: # If list is 0, there is no peak. return None if len(arr) == 1: # If list has been reduced to 1 element, it's a peak. return arr[0] if len(arr) == 2: if arr[...


Top 50 recent answers are included