Jan-07-2019, 10:18 PM
I am confused, do you want to multiply every number by the same constant or multiply them with a corresponding number in another list?
If you want to do the second, don't use functools.
Do this:
If you want to do the second, don't use functools.
Do this:
lista = [1, 2, 3, 4] listb = [2, 3, 4, 5] print([a*b for a,b in zip(lista,listb)])would give:
Output:[2, 6, 12, 20]