a = (1,2)
b = (3,4)
plus = a + b
multi = a * 2
multi2 = a * b
print(plus)
print(multi)
print(multi2)
terminal
multi2 = int(a * b)
TypeError: can't multiply sequence by non-int of type 'tuple'
I don’t know why it’s not working…
Can’t I use multi2?
ps. I used a translator.
>Solution :
change this line :
multi2 = a * b
to :
multi2 = tuple(l * r for l, r in zip(a, b))
The simplest way to multiply two tuple.