On Sun, 05 Apr 2020 19:46:00 +0200
Pieter van Oostrum wrote:
> Sathvik Babu Veligatla writes:
>
> > hi,
> > I am new to python, and i am trying to output the prime numbers
> > beginning from 3 and i cannot get the required output. It stops
> > after giving the output "7" and that's it.
> >
Sathvik Babu Veligatla writes:
> hi,
> I am new to python, and i am trying to output the prime numbers beginning
> from 3 and i cannot get the required output.
> It stops after giving the output "7" and that's it.
>
> CODE:
> a = 3
> l = []
> while True:
> for i in range(2,a):
> if
On Sunday, April 5, 2020 at 8:03:19 PM UTC+5:30, inhahe wrote:
> On Sun, Apr 5, 2020 at 8:26 AM Sathvik Babu Veligatla <
> sathvikveliga...@gmail.com> wrote:
>
> > hi,
> > I am new to python, and i am trying to output the prime numbers beginning
> > from 3 and i cannot get the required output.
>
On Sunday, April 5, 2020 at 8:03:19 PM UTC+5:30, inhahe wrote:
> On Sun, Apr 5, 2020 at 8:26 AM Sathvik Babu Veligatla <
> sathvikveliga...@gmail.com> wrote:
>
> > hi,
> > I am new to python, and i am trying to output the prime numbers beginning
> > from 3 and i cannot get the required output.
>
On Sun, Apr 5, 2020 at 8:26 AM Sathvik Babu Veligatla <
sathvikveliga...@gmail.com> wrote:
> hi,
> I am new to python, and i am trying to output the prime numbers beginning
> from 3 and i cannot get the required output.
> It stops after giving the output "7" and that's it.
>
> CODE:
> a = 3
> l =
On 2020-04-05 05:22:45 -0700, Sathvik Babu Veligatla wrote:
> I am new to python, and i am trying to output the prime numbers
> beginning from 3 and i cannot get the required output. It stops after
> giving the output "7" and that's it.
A technique I learned when I started programming (back in
> On 5 Apr 2020, at 14:08, Sathvik Babu Veligatla
> wrote:
>
> On Sunday, April 5, 2020 at 6:09:04 PM UTC+5:30, Chris Angelico wrote:
>> On Sun, Apr 5, 2020 at 10:26 PM Sathvik Babu Veligatla
>> wrote:
>>>
>>> hi,
>>> I am new to python, and i am trying to output the prime numbers
On Sunday, April 5, 2020 at 6:09:04 PM UTC+5:30, Chris Angelico wrote:
> On Sun, Apr 5, 2020 at 10:26 PM Sathvik Babu Veligatla
> wrote:
> >
> > hi,
> > I am new to python, and i am trying to output the prime numbers beginning
> > from 3 and i cannot get the required output.
> > It stops after
On Sunday, April 5, 2020 at 6:04:20 PM UTC+5:30, Orges Leka wrote:
> You can try the following:
> It is based on trial division and very slow, compared to the state of the
> art:
>
> import math
> def is_prime(n):
> if int(math.sqrt(n))**2 == n:
> return(False)
> for i in
On Sun, Apr 5, 2020 at 10:35 PM Orges Leka wrote:
>
> You can try the following:
> It is based on trial division and very slow, compared to the state of the
> art:
>
I think it's more helpful to assist the OP in learning coding, rather
than provide a completely different function to do a similar
On Sun, Apr 5, 2020 at 10:26 PM Sathvik Babu Veligatla
wrote:
>
> hi,
> I am new to python, and i am trying to output the prime numbers beginning
> from 3 and i cannot get the required output.
> It stops after giving the output "7" and that's it.
>
> CODE:
> a = 3
> l = []
> while True:
>
You can try the following:
It is based on trial division and very slow, compared to the state of the
art:
import math
def is_prime(n):
if int(math.sqrt(n))**2 == n:
return(False)
for i in range(2,int(math.ceil(math.sqrt(n:
if n%i==0:
return(False)
hi,
I am new to python, and i am trying to output the prime numbers beginning from
3 and i cannot get the required output.
It stops after giving the output "7" and that's it.
CODE:
a = 3
l = []
while True:
for i in range(2,a):
if a%i == 0:
l.append(1)
else:
13 matches
Mail list logo