Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 44 lines (30 sloc) 0.728 kB
b5f86e6 @inducer Fix stripping of initial newline from source.
authored
1
ac18daa @inducer Yay! We have a useful debugger!
authored
2 def simple_func(x):
3 x += 1
07ab410 @inducer Add tons of features. Should be ready for release 0.91.
authored
4
5 s = range(20)
6 z = None
7 w = ()
8
9 y = dict((i, i**2) for i in s)
10
11 k = set(range(5, 99))
12
13 try:
14 x.invalid
15 except AttributeError:
16 pass
17
18 #import sys
19 #sys.exit(1)
20
ac18daa @inducer Yay! We have a useful debugger!
authored
21 return 2*x
22
389d874 @inducer Initial checkin.
authored
23 def fermat(n):
24 """Returns triplets of the form x^n + y^n = z^n.
25 Warning! Untested with n > 2.
26 """
5eefca6 @inducer Attribution for debug_me.py.
authored
27
28 # source: "Fermat's last Python script"
29 # https://earthboundkid.jottit.com/fermat.py
30 # :)
31
a5ca958 @inducer Bump version. Add IPython integration.
authored
32 for x in range(100):
389d874 @inducer Initial checkin.
authored
33 for y in range(1, x+1):
34 for z in range(1, x**n+y**n + 1):
35 if x**n + y**n == z**n:
36 yield x, y, z
37
ac18daa @inducer Yay! We have a useful debugger!
authored
38 print "SF", simple_func(10)
39
389d874 @inducer Initial checkin.
authored
40 for i in fermat(2):
41 print i
42
a5ca958 @inducer Bump version. Add IPython integration.
authored
43 print "FINISHED"
Something went wrong with that request. Please try again.