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.