News for hackers. Stuff that matters.
Re:Choosing a Programming Language for Interviews by benhoyt on Wednesday February 05, 2014 @02:21PM (#7186092)
Really, that's easy peasy? Looks terrible to a Python programmer. :-)

   with open('input') as fin, open('output', 'w') as fout:
       for line_num, line in enumerate(fin, 1):
           fout.write('{0}\n'.format(int(line) * line_num))
Re:Choosing a Programming Language for Interviews by biscarch on Wednesday February 05, 2014 @03:16PM (#7186487)
I would've went with Haskell myself ;)

    main :: IO ()
    main = writeListAsLines . toDoubleList . lines =<< readFile "nums.txt"
           where
             toDoubleList y = zipWith (*) (map read y) [1..length y]
             writeListAsLines z =  writeFile "output.txt" (concat $ intersperse "\n" $ map show z)