For example, if we run 5678 through the function, 25364964 will come out. So I wrote a code like this.
number = 5678
for ch in str(number):
print (int(ch)**2, end="")
And got the correct output.
25364964
However, if I put this code under a function, the expected result isn't showing up.
def square_every_number(number):
for ch in str(number):
return ((int(ch)**2))
print(square_every_number(5678))
Output:
25
I'm getting only the square for the first digit.