Allen Chen

Generation

generate functionMon, 03 Apr 2023

251 GB Flash Storage

def convert_storage(size): unit=['KB', 'MB', 'GB', 'TB'] i=0 while size > 1024: size /= 1024 i += 1 return str(size) + unit[i] print(convert_storage(1099511627776)) # Should be 1 TB

Questions about programming?Chat with your personal AI assistant