How to convert kilobytes to megabytes in Python

1 Answer

0 votes
def kilobytestomegabytes(kilobytes):
    return kilobytes / 1024
  
megabytes = kilobytestomegabytes(102400)
 
s = '{:,.2f} MB'.format(megabytes)
print(s)
  


'''
run:
   
100.00 MB
   
'''

 



answered Oct 19, 2020 by avibootz
...