-
Notifications
You must be signed in to change notification settings - Fork 230
/
debug_me.py
67 lines (41 loc) · 1.12 KB
/
debug_me.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
from collections import namedtuple
Color = namedtuple("Color", ["red", "green", "blue", "alpha"])
class MyClass(object):
def __init__(self, a, b):
self.a = a
self.b = b
self._b = [b]
mc = MyClass(15, MyClass(12, None))
from pudb import set_trace
set_trace()
def simple_func(x):
x += 1
s = range(20)
z = None # noqa: F841
w = () # noqa: F841
y = {i: i**2 for i in s} # noqa: F841
k = set(range(5, 99)) # noqa: F841
c = Color(137, 214, 56, 88) # noqa: F841
try:
x.invalid # noqa: B018
except AttributeError:
pass
# import sys
# sys.exit(1)
return 2*x
def fermat(n):
"""Returns triplets of the form x^n + y^n = z^n.
Warning! Untested with n > 2.
"""
# source: "Fermat's last Python script"
# https://earthboundkid.jottit.com/fermat.py
# :)
for x in range(100):
for y in range(1, x+1):
for z in range(1, x**n+y**n + 1):
if x**n + y**n == z**n:
yield x, y, z
print("SF %s" % simple_func(10))
for i in fermat(2):
print(i)
print("FINISHED")