How to convert megabytes to terabytes in Python

1 Answer

0 votes
def megabytestoterabytes(megabytes):
    return (megabytes / 1024) / 1024
  
terabytes = megabytestoterabytes(8459735)
 
s = '{:,.2f} TB'.format(terabytes)
print(s)
  

 
  
   
'''
run:
   
8.07 TB
   
'''

 



answered Oct 19, 2020 by avibootz
...