Removing whitespaces from items of the list in Python
Removing whitespaces from items of the list in Python Question: In this Python code def addToArrayForm(num,k): num_string = "" answer = [] for n in num: num_string += str(n) num_string = int(num_string) + k # This is an integer for i in str(num_string): answer.append(int(i)) print(answer) addToArrayForm([1,2,0,0], 34) I get this output => [1, 2, 3, …