Hello Python wizards out there, hope you all are doing well!
I just took birth in python world a few months ago so please pardon my lack of knowledge here. I am trying to do basic multiplication within all the individual elements of this list but where am I going wrong with using lambda expression here?
inputData = [[2,3], ["4", 7], [6,4], [222, 25, 7],["16",22,"12", 6]]
code I wanted to replicate:
for element in inputData:
value = 1
for multi in element:
if isinstance(multi, str):
multi = int(multi)
value = value*multi
print(value)
Code I am trying:
for element in inputData:
value = 1
for multi in element:
multiplication = lambda multi: int(multi)*value if isinstance(multi, str) == True else
multi*value
print(multiplication(inputData))