def is_prime(x): if x>1: y = 2 while y < x: if x % y == 0: return False break y+=1 if y == x: return True else: return str(x) + "is surely a prime number" print is_prime(263) print is_prime(262) print is_prime(1) i = 2 j = 15 f = 20 k = (j/i) == int(j/i) l = (f/i) == int(f/i) m = j % i == 0 n = f % i == 0 print k print l print m print n
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