import math import random def pytriples(c): int b1 = 1 int a1 = 1 while a1>0: a1 = random.randint(1,c) b1 = random.randint(1,c) as1 = a1 ** 2 bs1 = b1 ** 2 sqab = math.sqrt(as1+bs1) if isinstance(sqab,int): print a1 print b1 print math.sqrt(
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