+ 1

What is wrong this one

A = 1 for x in range (2,600851475143): flage = True if(600851475143%x == 0): for y in range (2,x): if(x%y == 0): flage = False break if(flage): A = x print(A)

14th Aug 2019, 1:31 AM
Deshitha Dhananjaya
Deshitha Dhananjaya - avatar
4 Answers
+ 4
What exactly is it supposed to do?
14th Aug 2019, 2:02 AM
Diego
Diego - avatar
+ 1
Find the largest prime number less than 600851475143
14th Aug 2019, 2:10 AM
Deshitha Dhananjaya
Deshitha Dhananjaya - avatar
+ 1
First thing, it's gonna take a lot of time to execute this code, if you tried to test it in Sololearn, just forget it. Second : what's the logic behind your code after line 4 ??
14th Aug 2019, 2:34 AM
RZK 022
RZK 022 - avatar
+ 1
To find prime numbers
14th Aug 2019, 2:52 AM
Deshitha Dhananjaya
Deshitha Dhananjaya - avatar