Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fibonacci():
- start_number, next_number = 0, 1
- while True:
- yield start_number
- start_number, next_number = next_number, start_number + next_number
- generator = fibonacci()
- for i in range(10):
- print(next(generator), end=' ')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement