From 02155def00f7bcc16e4c6df6b7891a90696e44fe Mon Sep 17 00:00:00 2001 From: Sanders Lin <45224617+SandersLin@users.noreply.github.com> Date: Wed, 13 Feb 2019 00:40:05 +0800 Subject: [PATCH] Create project Euler problem 9 sol3.py (#645) --- project_euler/problem_09/sol3.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 project_euler/problem_09/sol3.py diff --git a/project_euler/problem_09/sol3.py b/project_euler/problem_09/sol3.py new file mode 100644 index 000000000..5ebf38e76 --- /dev/null +++ b/project_euler/problem_09/sol3.py @@ -0,0 +1,6 @@ +def main(): + print([a*b*c for a in range(1,999) for b in range(a,999) for c in range(b,999) + if (a*a+b*b==c*c) and (a+b+c==1000 ) ][0]) + +if __name__ == '__main__': + main()