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
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
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
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
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
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
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
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
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
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
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,
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
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
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
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
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
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:
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:
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
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
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
--
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
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' % (''
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
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
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,
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)
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
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
[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
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
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
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
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
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
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
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
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
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.
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
40 matches
Mail list logo