I'm trying to add the results of one list to another list, but I keep getting this error. What's going on?
I've tried to write the resistance * current equation in every order possible. I'm required to include a 'for' loop, input statements (NOT eval(input)), and it only involves entering in five variables for the current statement.
current = []
power = []
current = input("Enter in your numbers: ")
current = current.split()
current = [eval(x) for x in current]
resistance = [16, 27, 39, 56, 81]
print("[resistance, current, power]")
power = current * resistance
for i in range(5):
print([resistance[i], current[i]], power[i])
print([sum(resistance), sum(current)])
I keep getting the error: TypeError: can't multiply sequence by non-int of type 'list'
I want to be able to multiply current^2 with resistance, and store that in a variable called 'power.'