@@ -0,0 +1,1341 @@
+#!/Applications/anaconda/envs/Python3/bin%0A%0A%0Adef main():%0A    # Test suite%0A    tests = %5B%0A        #%5BNone, None%5D, # Should throw a TypeError%0A        #%5B0, False%5D,%0A        #%5B1, True%5D,%0A        %5B2, True%5D,%0A        %5B15, False%5D,%0A        %5B16, True%5D,%0A        %5B65536, True%5D,%0A        %5B65538, False%5D%0A    %5D%0A%0A    for item in tests:%0A        try:%0A            temp_result = is_power_of_two(item%5B0%5D)%0A            if temp_result == item%5B1%5D:%0A                print('PASSED: is_power_of_two(%7B%7D) returned %7B%7D'.format(item%5B0%5D, temp_result))%0A            else:%0A                print('FAILED: is_power_of_two(%7B%7D) returned %7B%7D, should have returned %7B%7D'.format(item%5B0%5D, temp_result, item%5B1%5D))%0A%0A        except TypeError:%0A            print('PASSED TypeError test')%0A%0A    return 0%0A%0A%0Adef is_power_of_two(val):%0A        '''%0A        Determines if val is a power of two%0A        Input: val is a positive integer%0A        Output: Boolean%0A        '''%0A        # Check input%0A        if type(val) is not int:%0A            raise TypeError('Input must be an integer')%0A%0A        # Trivial cases%0A        if val %3C= 0:%0A            return False%0A%0A        if val == 1:%0A            return True%0A%0A        # Repeat divisions by 2 until val = 2%0A        while val %3E 1:%0A            if val %25 2 == 1:%0A                return False%0A%0A            val /= 2%0A%0A        return True%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add powerOfTwo problem and tests