Last active
December 14, 2015 20:09
-
-
Save timtan/5142320 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import threading | |
| import time | |
| ending = False | |
| def response(): | |
| while not ending: | |
| print('.') | |
| time.sleep(1) | |
| def fib(num): | |
| time.sleep(1) | |
| if num < 2: | |
| return num | |
| return fib(num-1) + fib(num-2) | |
| thread = threading.Thread(target=response, name='') | |
| thread.start() | |
| print(fib(3)) | |
| ending = True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment