Skip to content

Instantly share code, notes, and snippets.

@AnisahTiaraPratiwi
Created March 20, 2021 10:05
Show Gist options
  • Save AnisahTiaraPratiwi/3ff749a9ff6c9cbee073a717bb23ed3b to your computer and use it in GitHub Desktop.
Save AnisahTiaraPratiwi/3ff749a9ff6c9cbee073a717bb23ed3b to your computer and use it in GitHub Desktop.
Most hard drives are divided into sectors of 512 bytes each. Our disk has a size of 16 GB. Fill in the blank to calculate how many sectors the disk has. Note: Your result should be in the format of just a number, not a sentence.
disk_size = 16*1024*1024*1024
sector_size = 512
sector_amount = (((16*1024*1024*1024)/512))
print(sector_amount)
@nabishanoman
Copy link

thank you so much. it was really helpfull

@KadaHawa
Copy link

Line 3 should be "sector_amount = ((disk_size/sector_size))"

@Kakemu
Copy link

Kakemu commented Feb 27, 2022

@KadaHawa it's the same

@programerarse79
Copy link

Thank you, it is very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment