Answers for "concatenate the squares of numbers in python"

0

concatenate the squares of numbers in python

return ''.join(str(int(i)**2) for i in str(num))
Posted by: Guest on January-08-2022
0

concatenate the squares of numbers in python

def sq(num):
    words = list(str(num)) # split the text
    for word in words:  # for each word in the line:
        print(int(word)**2, end="") # print the word

num = 9119
sq(num)
Posted by: Guest on January-08-2022

Code answers related to "concatenate the squares of numbers in python"

Python Answers by Framework

Browse Popular Code Answers by Language