Answers for "Create a function that given an integer, returns an integer where every digit in the input integer is squared."

0

Create a function that given an integer, returns an integer where every digit in the input integer is squared.

def sq_every_num(number):
    result = ''
    for ch in str(number):
        result += str(int(ch) ** 2)    
    return int(result)
Posted by: Guest on April-16-2021

Code answers related to "Create a function that given an integer, returns an integer where every digit in the input integer is squared."

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language