Answer:
def calculate_storage(filesize):
block_size = 4096
full_blocks = filesize // block_size
partial_block = filesize % block_size
if partial_block > 0:
return (full_blocks + 1) * block_size
return filesize
print(calculate_storage(1))
print(calculate_storage(4096))
print(calculate_storage(4097))
Explanation:
The python program defines the function 'calculate_storage' that calculates the block storage used. It gets the number of blocks used to store the data by making a floor division to get the integer value, then it checks for remaining spaces in the block. If there are spaces left, it adds one to the full_blocks variable and returns the result of the multiplication of the full_blocks and block_size variables.