Re: python script to give a list of prime no.

2020-04-05 Thread Sathvik Babu Veligatla
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

Re: python script to give a list of prime no.

2020-04-05 Thread Sathvik Babu Veligatla
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

Re: python script to give a list of prime no.

2020-04-05 Thread Sathvik Babu Veligatla
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 requi

Re: python script to give a list of prime no.

2020-04-05 Thread Sathvik Babu Veligatla
) > for i in range(2,int(math.ceil(math.sqrt(n: > if n%i==0: > return(False) > return(True) > > then: > > primes = [x for x in range(1,1000) if is_prime(x)] > > print(primes) > > Kind regards, > Orges > > Am So., 5. Ap

python script to give a list of prime no.

2020-04-05 Thread Sathvik Babu Veligatla
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: