Python problem

CAN anybody solve this question i am having issues

If a filesystem has a block size of 4096 bytes, this means that a file comprised of only one byte will still use 4096 bytes of storage. A file made up of 4097 bytes will use 4096*2=8192 bytes of storage. Knowing this, can you fill in the gaps in the calculate_storage function below, which calculates the total number of bytes needed to store a file of a given size?

hi @ompal

can I know where you got this query from?
if this is Google interview query, I found this link from GitHub

Hope this helps!

Regards
DP

1 Like

As you may have learned in the course, for extra practice, ask the chatbot for help understanding how the calculate_storage function works, ask for step-by-step instructions on determining the number of blocks needed, and calculate total storage based on a file’s size and block size.

1 Like