Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

convert number to time python

time = 72.345.
​
hours = int(time)
minutes = (time*60) % 60.
seconds = (time*3600) % 60.
​
print("%d:%02d.%02d" % (hours, minutes, seconds))
>> 72:20:42.
Comment

PREVIOUS NEXT
Code Example
Python :: select columns from dataframe pandas 
Python :: python list flatten 
Python :: create spark dataframe in python 
Python :: python get square root 
Python :: check dictionary is empty or not in python 
Python :: python how to get directory of script 
Python :: floyd triangle python 
Python :: make column nullable django 
Python :: reverse shell python 
Python :: make beep python 
Python :: How can one find the three largest values of an input array efficiently, namely without having to sort the input array? 
Python :: append to csv python 
Python :: python game over screen 
Python :: drop na in pandas 
Python :: kill turtle 
Python :: python get object attribute by string 
Python :: scanning 2d array in python 
Python :: python sort 2d list 
Python :: add column names to dataframe pandas 
Python :: parcourir une liste par la fin python 
Python :: how to get iheight in pyqt5 
Python :: command prompt pause in python 
Python :: fastapi upload image PIL 
Python :: spacex 
Python :: python filter a dictionary 
Python :: qlabel alignment center python 
Python :: change value to string pandas 
Python :: python auto updating clock 
Python :: python socket recv timeout 
Python :: python remove all except numbers 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =