y = 1 x = 600851475143 ls = [] running=True def is_prime(a): for i in range(2, a): if a%i == 0: return False break elif a%i > 0: return True break while running: print(str(y)+'/'+str(x)+" "+ str(y/x*100) + "% complete.") if x%y == 0 and is_prime(y): ls.append(y) y=y+1 if y==x: lastCalc= "The biggest multiple of "+str(x)+" is "+str(y) result=open("resultp3.txt", "w") result.write(lastCalc) result.close() else: y=y+1
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question