Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import threading
- from random import randint
- import time
- def add(n1, n2):
- print "%d + %d = %d"%(n1,n2,(n1+n2))
- time.sleep(4)
- return n1 + n2
- def main():
- thr = []
- for i in range(5):
- t = threading.Thread(target=add, args=(randint(1,700),randint(999,4000)))
- thr.append(t)
- t.start()
- main()
Add Comment
Please, Sign In to add comment