Skip to content

Instantly share code, notes, and snippets.

View stefansphtr's full-sized avatar
:shipit:
Focusing

Stefanus Bernard Melkisedek stefansphtr

:shipit:
Focusing
View GitHub Profile
@stefansphtr
stefansphtr / function_exercise.md
Last active February 20, 2024 14:01
Function exercise

Function Calculate Storage


This Python function, calculate_storage, calculates the total storage space required to store a file of a given size in bytes.

The storage system allocates space in blocks of 4096 bytes each. The function determines the number of fully occupied blocks

and checks if there's any remaining space that would require an additional block. If there is, it adds an extra block to the total.

The function returns the total storage space required in bytes.

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example