What are the first 4 results printed by this code:
a, b = 0, 1
while b < 1000:
a, b = b, a+b
What does this code display ?
def scalar_product(v1, v2):
return sum([a*b for a,b in zip(v1, v2)])
new_vector = functools.partial(create_vector, z=0)
v1 = new_vector(1, 3)
v2 = new_vector(4, -2)
Write a function to calculate the sum of first 'n' integers
Using list comprehension, write a function that displays integers divisible by 7 between 0 and 'n'
Using generator expression, write a function to list the first 'n' integers divisible by 7
Write a context manager to calculate the wall-clock time taken by a code block
Write a class to represent a shutter, ie. something that can be 'open' or 'closed'
Explain briefly the difference between a thread and a coroutine run by a scheduler
Tell 3 differences between Python 2 and Python 3