**Not able to add the given list a
a = ['1','2','3','4','5','6']
def sums (a):
return sum(a)
print(sums(a))
gives me error unsupported operand type(s) for +: 'int' and 'str'
i understand that i can't add list of str implicitly without converting them to int, but when i try to convert the list a into int
a = ['1','2','3','4','5','6']
def sums (a):
int_a = int(a)
return sum(a)
print(sums(a))
it still gives me the error **
int() argument must be a string, a bytes-like object or a number, not 'list'
just a learner, any help would be much appreciated!