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)
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)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us