I am doing a computer science project and I have to take a string that contains numbers, double each number individually and then return the doubled integers as one large string.
I tried this code:
def double_my_digit s(str):
new_digits = []
for c in str:
b = int(c)
a = b*2
x = str(a)
new_digits.appe nd(x)
return "".join(new_dig its)
But then it tells me that str object is not callable. I was wondering why I can't convert the new int into a string before appending to the list.
Any help would be great! And thanks in advance.
I tried this code:
def double_my_digit s(str):
new_digits = []
for c in str:
b = int(c)
a = b*2
x = str(a)
new_digits.appe nd(x)
return "".join(new_dig its)
But then it tells me that str object is not callable. I was wondering why I can't convert the new int into a string before appending to the list.
Any help would be great! And thanks in advance.
Comment