python interview quuestions

Terry Reedy tjreedy at udel.edu
Sun Aug 8 16:49:40 EDT 2010


On 8/7/2010 7:53 AM, Peter Otten wrote:

>
> You mean you'd go for the candidate who took the conservative approach and
> got it right:
>
> print 1
> print 2
> print 'Fizz'
> print 4
> print 'Buzz'
> print 'Fizz'
> print 7
> print 8
> print 'Fizz'
> print 'Buzz'

Way too verbose. How about
print("1\n2\nFizz\n4\nBuzz\nFizz\n7\n8\nFizz\nBuzz\n
etc.

-- 
Terry Jan Reedy




More information about the Python-list mailing list