From 1879caa1dd80cb11dd62403663917ad4bf7cc68e Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 11 Aug 2019 22:41:34 +0200 Subject: rename all file with 3 zero padding --- python/036-double_base_palindrome.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 python/036-double_base_palindrome.py (limited to 'python/036-double_base_palindrome.py') diff --git a/python/036-double_base_palindrome.py b/python/036-double_base_palindrome.py new file mode 100644 index 0000000..758ad1b --- /dev/null +++ b/python/036-double_base_palindrome.py @@ -0,0 +1,8 @@ +# https://projecteuler.net/problem=36 + +sum = 0 +for nb in range(1_000_000): + if str(nb) == str(nb)[::-1] and f'{nb:b}' == f'{nb:b}'[::-1]: + sum += nb + +print(sum) -- cgit