11
\$\begingroup\$

My answer here works only on the interactive Python prompt, which writes output to the screen if not stored in a variable or None. Is such an answer valid?

\$\endgroup\$
2
  • 2
    \$\begingroup\$ Given the poor wording of the question “output must read”, is not clear. Personally I would prefer to avoid such answers – if everybody comes with one like that, the challenge will not be challenging anymore. By the way, that solution is also valid in browsers' JavaScript consoles and if you change to double quotes, in interactive Ruby too. \$\endgroup\$
    – manatwork
    Jan 23, 2014 at 15:01
  • 2
    \$\begingroup\$ With double quotes, it would also be valid in non-interactive GolfScript (which inherits Ruby's double quoted string syntax wholesale, and has auto-printing of program return values built in). I'll leave it to others to decide if that's an argument for or against it. \$\endgroup\$ Jan 23, 2014 at 19:36

1 Answer 1

16
\$\begingroup\$

In my opinion, such answers should be valid unless the OP states otherwise.

These answers often reflect a different slant to the problem, and we all like variety, don't we? I don't think we should remove this dimension of creativity by default, but if the OP doesn't want such answers, they can of course say so.

From the perspective of a code golfer, I like to avoid the overhead of output that come with some languages. Some languages (such as GolfScript) produce output automatically, so I think it's fair to use a REPL interpreter to do the same thing.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .