Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class FibonacciModel(ModelInterface):
- def Generate(self):
- cval = self.GetValue()
- # Get the next one
- for fib in self.fibonacci():
- if fib > cval:
- self.SetValue(fib)
- break
- #@staticmethod
- #def fibonacci():
- def fibonacci(self):
- """Fibonacci generator method"""
- a, b = 0, 1
- while 1:
- yield a
- a, b = b, a + b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement