"Siren Saren" wrote
say I have a list that's a composite of two elements:
books and key pages / albums and favorite tracks /
medicines and times taken, whatever.
Thats a good scenario for using a dictionary containing
a list or tuple per key.
To make a program that does something to the
fir
I was trying to write a code that prints prime numbers between 1 and 20.
I have by myself seen that something is wrong with my code and also my
brain.
Could anyone be kind enough to tell me what to do
Where I am confused is how to test for other numbers without one and the
number itself. It
Hi,
You have two different problems
1) Easiest algorithm to find a prime number
2) and then coding the algorithm
By my knowledge,The Sieve of Eratosthenes algorithm is the fastest to find a
prime number.
The algorithm works on the basis that if a number n is prime, then all
multiples of it are no
On Tue, Jul 13, 2010 at 11:50 AM, Dipo Elegbede wrote:
> I was trying to write a code that prints prime numbers between 1 and 20.
>
> I have by myself seen that something is wrong with my code and also my
> brain.
>
> Could anyone be kind enough to tell me what to do
>
> Where I am confused is
Adding to what Andre said,
another way of optimizing the problem would be
storing the prime number in the range you want to check an array and see if
the given number is divisible by any of those prime number
This improves the performance.
Thanks,
nitin
On Tue, Jul 13, 2010 at 3:52 PM, Andre En
Dipo Elegbede wrote:
I was trying to write a code that prints prime numbers between 1 and 20.
I have by myself seen that something is wrong with my code and also my
brain.
Could anyone be kind enough to tell me what to do
Where I am confused is how to test for other numbers without one and
I'm not sure if there's a way to submit responses 'live' or
whether it's better to respond to subthreads at once or together, so I'll err
on the side of discretion and just send one response. Thanks to each of you
who tried to help me. I've responded individually below.
To summarize the
Alan,
Your message appeared on the forum right as I posted my response. Brief
unrelated thanks: your website has been a great help to me as I've been
learning python. I'm especially grateful to you for making it so easy to
download in various formats, since my health problems make it hard for
Dear all,
I'm trying to check the size of a component in a random graph with this code
(by a component I mean a maximal connected sub graph):
http://pastebin.com/SzC77HdU
I'm not 100 % sure that the code is working as it should but my question is
if there is a better way to design the w
Steven D'Aprano wrote:
My apologizes to Steven and the list, when I replied originally I messed
up and sent it to him privately which was not my intention.
> On Mon, 12 Jul 2010 03:42:28 am Jim Byrnes wrote:
>> I am running Ubuntu. I downloaded the source code examples for a
>> book I purcha
On 13 July 2010 14:43, Jim Byrnes wrote:
> Steven D'Aprano wrote:
>
> My apologizes to Steven and the list, when I replied originally I messed up
> and sent it to him privately which was not my intention.
>
>
>
> > On Mon, 12 Jul 2010 03:42:28 am Jim Byrnes wrote:
> >> I am running Ubuntu. I dow
Siren Saren, 13.07.2010 14:40:
I'm not sure if there's a way to submit responses 'live' or
whether it's better to respond to subthreads at once or together, so I'll err
on the side of discretion and just send one response.
It's not generally a problem to send one response like this regarding ma
On 7/12/2010 11:52 PM Dipo Elegbede said...
Which is what it will do when python is started from that directory.
I actually found the copies that were made by the code in the same
directory but found out that they all had a .thumbnail ext which would not
open and it is understandable.
I have h
You have gotten good advice from others.
My request is that you provide a meaningful subject when you post a
question. We track by subject. "Help" is not the best subject.
Better would be "How to find prime numbers"
--
Bob Gailer
919-636-4239
Chapel Hill NC
__
On Tue, Jul 13, 2010 at 8:40 AM, Siren Saren wrote:
> I'm not sure if there's a way to submit responses 'live' or whether it's
> better to respond to subthreads at once or together, so I'll err on the side
> of discretion and just send one response. Thanks to each of you who tried
> to help me.
On Tue, Jul 13, 2010 at 1:20 PM, David Hutto wrote:
>
>
> On Tue, Jul 13, 2010 at 8:40 AM, Siren Saren wrote:
>
>> I'm not sure if there's a way to submit responses 'live' or whether it's
>> better to respond to subthreads at once or together, so I'll err on the side
>> of discretion and just s
"Siren Saren" wrote
unrelated thanks: your website has been a great help
Thanks for the kind words :-)
The idea of making this into an object appeals to me
very much, because I've been trying to get my head around
creating objects as well as just using them.
It has some advantages since i
Adam Bark wrote:
On 13 July 2010 14:43, Jim Byrnes wrote:
Steven D'Aprano wrote:
My apologizes to Steven and the list, when I replied originally I messed up
and sent it to him privately which was not my intention.
On Mon, 12 Jul 2010 03:42:28 am Jim Byrnes wrote:
I am running Ubuntu. I
On 13 July 2010 23:27, Jim Byrnes wrote:
> Adam Bark wrote:
>
>> On 13 July 2010 14:43, Jim Byrnes wrote:
>>
>> Steven D'Aprano wrote:
>>>
>>> My apologizes to Steven and the list, when I replied originally I messed
>>> up
>>> and sent it to him privately which was not my intention.
>>>
>>>
>>>
On Tue, 13 Jul 2010 10:40:44 pm Siren Saren wrote:
> I'm not sure if there's a way to submit responses 'live' or
> whether it's better to respond to subthreads at once or together, so
> I'll err on the side of discretion and just send one response.
Generally it's better, or at least more common,
Adam Bark wrote:
If I use the terminal to start the program it has no problem using the
file. There are multiple files in multiple directories so I was looking
for
a way to just double click them and have them run. If it turns out that
I
must make changes to or for each of the files it will
On 7/13/2010 5:50 AM, Dipo Elegbede wrote:
I was trying to write a code that prints prime numbers between 1 and 20.
Other suggestions
- you need only test divisors up to the square root of the candidate.
- you can easily eliminate all even numbers and numbers divisible by 3.
for i in range(0,
On Tue, Jul 13, 2010 at 3:20 PM, Dipo Elegbede wrote:
> I was trying to write a code that prints prime numbers between 1 and 20.
>
> I have by myself seen that something is wrong with my code and also my
> brain.
>
> Could anyone be kind enough to tell me what to do
>
> Where I am confused is
Hello all,
I'm struggling a bit trying to find the right way to deal with null
values in my sqlite database when querying it and processing the results
in python.
If my cursor.fetchall() results return the following:
(104, None, u'Sylvester', None, u'Evans', None, u'527-9210 Proin Av.',
u'L
24 matches
Mail list logo