What is the correct fix?
def scale(v, factor):
return v * factor
print(scale(factor=2))
- Pass both:
scale(3, factor=2)in the call - Pass both:
scale(factor=2, 3)in the call - Give
va default value in the signature - Swap the two parameters in the signature
v has no default, so omitting it raises TypeError for a missing argument.