Skip to content

Instantly share code, notes, and snippets.

@tfiers
Last active December 17, 2015 00:38
Show Gist options
  • Select an option

  • Save tfiers/5522095 to your computer and use it in GitHub Desktop.

Select an option

Save tfiers/5522095 to your computer and use it in GitHub Desktop.

Revisions

  1. tfiers revised this gist May 7, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Vraag7.py
    Original file line number Diff line number Diff line change
    @@ -10,5 +10,5 @@ def f(self, x=10):
    from pylab import *
    t = arange(-1E2, 8E2, .1)
    s = map(B().f, t)
    plot(t, s, 'r.') # Plot t versus s als rode punten.
    plot(t, s, 'r.') # Plot t versus s as red dots.
    show()
  2. tfiers created this gist May 5, 2013.
    14 changes: 14 additions & 0 deletions Vraag7.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    class A:
    def f(self, x): return self.f(x/2) + 1

    class B(A):
    def f(self, x=10):
    if x < 0: return self.f(x+200) + 2
    if x > 20: return A.f(self,x-50) + 3
    else: return x

    from pylab import *
    t = arange(-1E2, 8E2, .1)
    s = map(B().f, t)
    plot(t, s, 'r.') # Plot t versus s als rode punten.
    show()