stack = []
def push(val):
stack.append(val)
def pop():
val = stack[-1]
del stack[-1]
return val
push(3)
push(2)
push(1)
print(pop())
print(pop())
print(pop())
| import concurrent.futures | |
| import time | |
| start = time.perf_counter() | |
| def do_something(seconds): | |
| print(f'Sleeping {seconds} second(s)...') | |
| time.sleep(seconds) | |
| return f'Done Sleeping...{seconds}' | |
| with concurrent.futures.ProcessPoolExecutor() as executor: | |
| secs = [5, 4, 3, 2, 1] | |
| results = executor.map(do_something, secs) | |
| # for result in results: | |
| # print(result) | |
| finish = time.perf_counter() | |
| print(f'Finished in {round(finish-start, 2)} second(s)') |
1 git add ↳ It lets you add changes from the working directory into the staging area 2 git commit ↳ It lets you save a snapshot of currently...