Ad
  • Custom User Avatar

    Changed parameter input in Initial Solution to program_input.

  • Custom User Avatar

    No, input is definitely a reserved keyword. It's just that python does not raise any error if you want to override the value, but that's still a very bad habit.

    $ python 
    Python 2.7.13 (default, Jan 12 2017, 17:59:37) 
    [GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> input
    <built-in function input>
    >>> input = 10
    >>> input
    10
    
  • Custom User Avatar
    $ python2
    Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 26 2016, 12:10:39) 
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> input = 10
    >>> ^D
    $ python3
    Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 26 2016, 10:47:25) 
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> input = 10
    >>> ^D
    

    Afaik input is no longer a reserved keyword in python
    it may have been when you commented though.

  • Custom User Avatar

    typical kata solution in python, nice one

  • Custom User Avatar

    Nice kata, pretty simple and pretty hard.
    But 'input' is reserved word in Python, it'd be nice to change it.

  • Default User Avatar

    Yep, this problem is still here. First two lines of tests should be replaced to:
    bin = Alphabet['BINARY']; oct = Alphabet['OCTAL']; dec = Alphabet['DECIMAL']; hex = Alphabet['HEXA_DECIMAL'];
    allow = Alphabet['ALPHA_LOWER']; alup = Alphabet['ALPHA_UPPER']; alpha = Alphabet['ALPHA']; alnum = Alphabet['ALPHA_NUMERIC'];

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution