You will write a small calculator that gives the size of an image or a sound in any unit from bytes to GiB.
Your tasks.
in_unit, turn a number of bits into the unit named by unit: divide by 8, then by 1024 once for each step up the list UNITS.photo_mib to the size in MiB of a photo of 1024 by 768 pixels with a colour depth of 24 bits.fits to the number of songs of 4 MiB that fit on a card of 1 GiB.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…