Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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)
Comment

concatenate the squares of numbers in python

return ''.join(str(int(i)**2) for i in str(num))
Comment

PREVIOUS NEXT
Code Example
Python :: sorting-a-python-list-by-two-fields 
Python :: check for the negative integers and float 
Python :: last value added odoo 
Python :: display all rows pandas 
Python :: pep8 E302 
Python :: sample one point from distribution python 
Python :: plot by hour of day pandas 
Python :: Free the Bunny Prisoners 
Python :: mu python replicate array n times 
Python :: sonido sfr200a 
Python :: convert .tiff image stack to unit8 format 
Python :: how to apply 1nf dataframe in python 
Python :: handle dict invalid key python 
Python :: Python Print Variable Using the + operator to join variables 
Python :: task orchestration framework 
Python :: select rainfall events and calculate rainfall event total from time-series data 
Python :: Deleting files which start with a name 
Python :: python import file from same directory 
Python :: jsonpickle exclude py/object 
Python :: python image resize 
Python :: python classmethod property 
Python :: python read file to eof 
Python :: pandas parameters read 
Python :: python move all txt files 
Python :: Arduino - Send Commands with Serial Communication with python 
Python :: Find & set values in pandas Dataframe 
Python :: How do I know which animation is playing animation player 
Python :: python to pseudo code converter 
Python :: plotly colors 
Python :: insert list 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =