Re: do you fail at FizzBuzz? simple prog test

2008-10-06 Thread Tobiah
Or to allow the numbers 3 and 5 to be easily changed: for i in range(1, 101): print 'fizz' * (not i % 3) + 'buzz' * (not i % 5) or i Tobiah for i in range(1,100): print ('fizz','','')[i%3] + ('buzz','','','','')[i%5] or i Write a program that prints the numbers from 1 to 100. But

Re: do you fail at FizzBuzz? simple prog test

2008-10-03 Thread Chuckk Hubbard
range(1,101), no? On Tue, May 20, 2008 at 4:46 PM, Sells, Fred [EMAIL PROTECTED] wrote: or for i in range(1,100): print ('fizz','','')[i%3] + ('buzz','','','','')[i%5] or i Write a program that prints the numbers from 1 to 100. But for multiples of three print Fizz instead of the

Re: do you fail at FizzBuzz? simple prog test

2008-05-20 Thread Wolfgang Grafen
globalrev schrieb: http://reddit.com/r/programming/info/18td4/comments claims people take a lot of time to write a simple program like this: Write a program that prints the numbers from 1 to 100. But for multiples of three print Fizz instead of the number and for the multiples of five print

Re: do you fail at FizzBuzz? simple prog test

2008-05-20 Thread castironpi
On May 20, 6:57 am, Wolfgang Grafen [EMAIL PROTECTED] wrote: globalrev schrieb: http://reddit.com/r/programming/info/18td4/comments claims people take a lot of time to write a simple program like this: Write a program that prints the numbers from 1 to 100. But for multiples of three

RE: do you fail at FizzBuzz? simple prog test

2008-05-20 Thread Sells, Fred
or for i in range(1,100): print ('fizz','','')[i%3] + ('buzz','','','','')[i%5] or i Write a program that prints the numbers from 1 to 100. But for multiples of three print Fizz instead of the number and for the multiples of five print Buzz. For numbers which are multiples of both

Re: do you fail at FizzBuzz? simple prog test

2008-05-14 Thread Gabriel Genellina
En Tue, 13 May 2008 19:31:03 -0300, Mensanator [EMAIL PROTECTED] escribió: Such as what's the voltage at point A? +5v | 220 ohm | +-- A | 330 ohm | ground Would you be surprised at how many applicants couldn't figure that out because they forgot to

Re: do you fail at FizzBuzz? simple prog test

2008-05-13 Thread Bruno Desthuilliers
Kam-Hung Soh a écrit : On Tue, 13 May 2008 03:42:30 +1000, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I just can't believe someone applying for a programmer position cannot provide a sensible anwser in 5 or less minutes. You should join the recruitment and interview panel in your

Re: do you fail at FizzBuzz? simple prog test

2008-05-13 Thread Matthew Woodcraft
Gabriel Genellina [EMAIL PROTECTED] wrote: I would like to write a similar problem without this non-programming distracting issues (that is, a problem simple enough to be answered in a few minutes, that requires only programming skills to be solved, and leaving out any domain-specific

Re: do you fail at FizzBuzz? simple prog test

2008-05-13 Thread John Machin
Matthew Woodcraft wrote: Gabriel Genellina [EMAIL PROTECTED] wrote: I would like to write a similar problem without this non-programming distracting issues (that is, a problem simple enough to be answered in a few minutes, that requires only programming skills to be solved, and leaving out

Re: do you fail at FizzBuzz? simple prog test

2008-05-13 Thread Mensanator
On May 13, 3:57 pm, John Machin [EMAIL PROTECTED] wrote: Matthew Woodcraft wrote: Gabriel Genellina [EMAIL PROTECTED] wrote: I would like to write a similar problem without this non-programming   distracting issues (that is, a problem simple enough to be answered in a   few minutes, that

Re: do you fail at FizzBuzz? simple prog test

2008-05-13 Thread miller . paul . w
On May 12, 3:55 am, [EMAIL PROTECTED] wrote: As a test, I would leave out the last sentence, and see how many people (and how fast) figure out than a number can be multiple of three _and_ five and that the requirement is somehow incomplete ... Actually, if you leave off the last sentence,

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Gabriel Genellina
En Sat, 10 May 2008 22:12:37 -0300, globalrev [EMAIL PROTECTED] escribió: http://reddit.com/r/programming/info/18td4/comments claims people take a lot of time to write a simple program like this: Write a program that prints the numbers from 1 to 100. But for multiples of three print Fizz

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread bockman
On 12 Mag, 09:00, Gabriel Genellina [EMAIL PROTECTED] wrote: En Sat, 10 May 2008 22:12:37 -0300, globalrev [EMAIL PROTECTED] escribió: http://reddit.com/r/programming/info/18td4/comments claims people take a lot of time to write a simple program like this: Write a program that prints

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Arnaud Delobelle
On May 11, 4:36 am, Grant Edwards [EMAIL PROTECTED] wrote: On 2008-05-11, John Machin [EMAIL PROTECTED] wrote: Write a program that prints the numbers from 1 to 100. But for multiples of three print Fizz instead of the number and for the multiples of five print Buzz. For numbers which

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Arnaud Delobelle
On May 12, 9:30 am, Arnaud Delobelle [EMAIL PROTECTED] wrote: [...] # FizzBuzzer in action: fizzbuzz = FizzBuzzer((3, 'Fizz'), (5, 'Buzz')) for val in fizzbuzz[1:21]: ...     print val ... 1 21 1 Ignore this, it's debugging output 1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Chris
On May 11, 3:12 am, globalrev [EMAIL PROTECTED] wrote: http://reddit.com/r/programming/info/18td4/comments claims people take a lot of time to write a simple program like this: Write a program that prints the numbers from 1 to 100. But for multiples of three print Fizz instead of the number

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Duncan Booth
Ivan Illarionov [EMAIL PROTECTED] wrote: is there a better way than my solution? is mine ok? ['%s%s' % (not i%3 and 'Fizz' or '', not i%5 and 'Buzz' or '') or str(i) for i in xrange(1, 101)] -- Ivan or, more correctly, if you actually need to print:

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread John Machin
Duncan Booth wrote: Ivan Illarionov [EMAIL PROTECTED] wrote: is there a better way than my solution? is mine ok? ['%s%s' % (not i%3 and 'Fizz' or '', not i%5 and 'Buzz' or '') or str(i) for i in xrange(1, 101)] -- Ivan or, more correctly, if you actually need to print:

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Arnaud Delobelle
On May 12, 1:30 pm, John Machin [EMAIL PROTECTED] wrote: Duncan Booth wrote: [...] I think the variant I came up with is a bit clearer: for i in range(1,101):    print '%s%s' % ('' if i%3 else 'Fizz', '' if i%5 else 'Buzz') or i More than a bit clearer, IMO. How about      print ('' if

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Max Erickson
Arnaud Delobelle [EMAIL PROTECTED] wrote: On May 12, 1:30 pm, John Machin [EMAIL PROTECTED] wrote: Duncan Booth wrote: [...] I think the variant I came up with is a bit clearer: for i in range(1,101):    print '%s%s' % ('' if i%3 else 'Fizz', '' if i%5 else 'Buzz') or i More than

RE: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Delaney, Timothy (Tim)
Mensanator wrote: Ok, I agree with 101, but I wouldn't necessarily say the others were unfortunate. You might be surprised at how often such fixations discover bugs, something that I have a gift for. The discovering, the making, or both? ;) Tim Delaney --

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Paul Hankin
On May 12, 1:59 pm, Arnaud Delobelle [EMAIL PROTECTED] wrote: On May 12, 1:30 pm, John Machin [EMAIL PROTECTED] wrote: Duncan Booth wrote: [...] I think the variant I came up with is a bit clearer: for i in range(1,101): print '%s%s' % ('' if i%3 else 'Fizz', '' if i%5 else

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Arnaud Delobelle
Paul Hankin [EMAIL PROTECTED] writes: On May 12, 1:59 pm, Arnaud Delobelle [EMAIL PROTECTED] wrote: On May 12, 1:30 pm, John Machin [EMAIL PROTECTED] wrote: Duncan Booth wrote: [...] I think the variant I came up with is a bit clearer: for i in range(1,101): print '%s%s' % (''

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread [EMAIL PROTECTED]
On 12 mai, 09:00, Gabriel Genellina [EMAIL PROTECTED] wrote: En Sat, 10 May 2008 22:12:37 -0300, globalrev [EMAIL PROTECTED] escribió: http://reddit.com/r/programming/info/18td4/comments claims people take a lot of time to write a simple program like this: Write a program that prints

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Grant Edwards
On 2008-05-12, Paul Hankin [EMAIL PROTECTED] wrote: for i in xrange(1, 101): print 'Fizz'*(i%31)+'Buzz'*(i%51) or i Doh! It never occured to me that 'string' * 0 == ''. -- Grant Edwards grante Yow! An air of FRENCH FRIES at

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Mensanator
On May 11, 7:05 pm, Delaney, Timothy (Tim) [EMAIL PROTECTED] wrote: Mensanator wrote: Ok, I agree with 101, but I wouldn't necessarily say the others were unfortunate. You might be surprised at how often such fixations discover bugs, something that I have a gift for. The discovering,

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Terry Reedy
Gabriel Genellina [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] En Sat, 10 May 2008 22:12:37 -0300, globalrev [EMAIL PROTECTED] escribió: | (We used this question last year - some people gave a sensible answer | in less | than 5 minutes, but others did not even know how to start)

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Kam-Hung Soh
On Tue, 13 May 2008 03:42:30 +1000, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I just can't believe someone applying for a programmer position cannot provide a sensible anwser in 5 or less minutes. You should join the recruitment and interview panel in your organization to test your

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread John Machin
Terry Reedy wrote: Gabriel Genellina [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] En Sat, 10 May 2008 22:12:37 -0300, globalrev [EMAIL PROTECTED] escribió: | (We used this question last year - some people gave a sensible answer | in less | than 5 minutes, but others did not even

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread alex23
[EMAIL PROTECTED] wrote: I just can't believe someone applying for a programmer position cannot provide a sensible anwser in 5 or less minutes. Try taking a look at the level of discourse in the Google App Engine group. It's pretty clear that some - let's say developers rather than programmers

Re: do you fail at FizzBuzz? simple prog test

2008-05-12 Thread Gabriel Genellina
En Mon, 12 May 2008 14:42:30 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: On 12 mai, 09:00, Gabriel Genellina [EMAIL PROTECTED] wrote: En Sat, 10 May 2008 22:12:37 -0300, globalrev [EMAIL PROTECTED] escribió: Write a program that prints the numbers from 1 to 100. But for

do you fail at FizzBuzz? simple prog test

2008-05-10 Thread globalrev
http://reddit.com/r/programming/info/18td4/comments claims people take a lot of time to write a simple program like this: Write a program that prints the numbers from 1 to 100. But for multiples of three print Fizz instead of the number and for the multiples of five print Buzz. For numbers

Re: do you fail at FizzBuzz? simple prog test

2008-05-10 Thread John Machin
globalrev wrote: http://reddit.com/r/programming/info/18td4/comments claims people take a lot of time to write a simple program like this: Write a program that prints the numbers from 1 to 100. But for multiples of three print Fizz instead of the number and for the multiples of five print

Re: do you fail at FizzBuzz? simple prog test

2008-05-10 Thread Kam-Hung Soh
On Sun, 11 May 2008 11:12:37 +1000, globalrev [EMAIL PROTECTED] wrote: http://reddit.com/r/programming/info/18td4/comments claims people take a lot of time to write a simple program like this: Write a program that prints the numbers from 1 to 100. But for multiples of three print Fizz

Re: do you fail at FizzBuzz? simple prog test

2008-05-10 Thread Mensanator
On May 10, 8:12�pm, globalrev [EMAIL PROTECTED] wrote: http://reddit.com/r/programming/info/18td4/comments claims people take a lot of time to write a simple program like this: Write a program that prints the numbers from 1 to 100. But for multiples of three print Fizz instead of the number

Re: do you fail at FizzBuzz? simple prog test

2008-05-10 Thread Grant Edwards
On 2008-05-11, John Machin [EMAIL PROTECTED] wrote: Write a program that prints the numbers from 1 to 100. But for multiples of three print Fizz instead of the number and for the multiples of five print Buzz. For numbers which are multiples of both three and five print FizzBuzz. for i in

Re: do you fail at FizzBuzz? simple prog test

2008-05-10 Thread Ivan Illarionov
On Sat, 10 May 2008 18:12:37 -0700, globalrev wrote: http://reddit.com/r/programming/info/18td4/comments claims people take a lot of time to write a simple program like this: Write a program that prints the numbers from 1 to 100. But for multiples of three print Fizz instead of the

Re: do you fail at FizzBuzz? simple prog test

2008-05-10 Thread Ivan Illarionov
On Sun, 11 May 2008 04:26:10 +, Ivan Illarionov wrote: On Sat, 10 May 2008 18:12:37 -0700, globalrev wrote: http://reddit.com/r/programming/info/18td4/comments claims people take a lot of time to write a simple program like this: Write a program that prints the numbers from 1 to

Re: do you fail at FizzBuzz? simple prog test

2008-05-10 Thread John Machin
On May 11, 1:24 pm, Mensanator [EMAIL PROTECTED] wrote: On May 10, 8:12�pm, globalrev [EMAIL PROTECTED] wrote: http://reddit.com/r/programming/info/18td4/comments claims people take a lot of time to write a simple program like this: Write a program that prints the numbers from 1 to 100.

Re: do you fail at FizzBuzz? simple prog test

2008-05-10 Thread Mensanator
On May 11, 12:04 am, John Machin [EMAIL PROTECTED] wrote: On May 11, 1:24 pm, Mensanator [EMAIL PROTECTED] wrote: On May 10, 8:12�pm, globalrev [EMAIL PROTECTED] wrote: http://reddit.com/r/programming/info/18td4/comments claims people take a lot of time to write a simple program