Terry Reedy <tj*****@udel.eduwrote:
>[['Fizz', 'Buzz', 'FizzBuzz', str(i)][62/(pow(i, 4, 15) + 1)%4] for i in xrange(1, 101)]
These make the lookup table variable, so it has to be recalculated for
each i.
So what? Mark Wooding was posting about mathematical elegance and came up
with that really neat pow() call. If runtime came into it then one of the
previous solutions or (as Mark already said) a straightforward sometable[i%
15] is going beat something like this hands-down.
This is coding for fun not profit.
--
Duncan Booth http://kupuguy.blogspot.com 1 817
On 20 ÉÀÎ, 11:31, Duncan Booth <duncan.bo...@invalid.invalidwrote:
Terry Reedy <tjre...@udel.eduwrote:
[['Fizz', 'Buzz', 'FizzBuzz', str(i)][62/(pow(i, 4, 15) + 1)%4] for i
in xrange(1, 101)]
These make the lookup table variable, so it has to be recalculated for
each i.
So what? Mark Wooding was posting about mathematical elegance and came up
with that really neat pow() call. If runtime came into it then one of the
previous solutions or (as Mark already said) a straightforward sometable[i%
15] is going beat something like this hands-down.
This is coding for fun not profit.
--
Duncan Boothhttp://kupuguy.blogspot.com
I can't resist...
[[i,"Fizz","Buzz","FizzBuzz"][(not i%3)+(not i%5)*2] for i in range(1,
101)]
Ivan This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Millissa |
last post by:
If someone can help me with examples of or info on how to create an advanced
tables for the layout on my site, I would be very grateful!
Thanks,
M
|
by: John Wells |
last post by:
Are there any books out there that are fairly current, but go into the
more advanced aspects of Postgresql, such as internals and advanced
programming? I'd rather avoid the whole intro to SQL with...
|
by: Mike Sweetman |
last post by:
I have a form Form1 which when the Advanced Filter/Sort is used
creates a form(maybe) with a title 'Form1Filter1 : Filter'. When I
apply the filter to Form1 it is applied, but the value of...
|
by: Nhmiller |
last post by:
This is directly from Access' Help:
"About designing a query
When you open a query in Design view, or open a form, report, or datasheet and
show the Advanced Filter/Sort window (Advanced...
|
by: John Robert |
last post by:
Hi!
Anyone has recommendations for advanced ASP.NET books? By
advanced, I mean complicated stuff... not just
authentification and datagrid binding
I'm mainly interrested in learning more...
|
by: vdrab |
last post by:
Hi all,
Is there some sort of coherent source (dead tree format, maybe?) on
some of the more advanced features
of python (decorators, metaclasses, etc)? I'm sort of looking for a
python book...
|
by: mike_li |
last post by:
Passed DB2 UDB 701 test, how can I prepare for 704 test (Advanced DBA)?
There is not as many info. on this test as on others.
Thanks.
Mike
|
by: jklimek |
last post by:
I'm currently a Delphi developer (my day job) but at my company we only
write custom web application/database stuff, so we never really get
into anything advanced. However, I know enough about...
|
by: Andrew Meador - ASCPA, MCSE, MCP+I, Network+, A+ |
last post by:
I am running Access 2007. I have a report that I want to filter. I
can go into Advanced...Advanced Filter/Sort... and setup a filter that
works fine on the report when I apply it. When in this...
|
by: cirfu |
last post by:
I am wondering if it is possible to write advanced listcomprehensions.
For example:
"""Write a program that prints the numbers from 1 to 100. But for
multiples of three print "Fizz" instead of...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |