![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 12.01.2021 18:20 neverfnmind
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 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?
1 def calculate_storage(filesize):
2 block_size = 4096
3 # Use floor division to calculate how many blocks are fully occupied
4 full_blocks = ___
5 # Use the modulo operator to check whether there's any remainder
6 partial_block_remainder = ___
7 # Depending on whether there's a remainder or not, return
8 if partial_block_remainder > 0:
9 return ___
10 return ___
11
12 print(calculate_storage(1)) # Should be 4096
13 print(calculate_storage(4096)) # Should be 4096
14 print(calculate_storage(4097)) # Should be 8192
15 print(calculate_storage(6000)) # Should be 8192
![ansver](/tpl/images/cats/User.png)
Answers: 2
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 08:00
What is a scenario where records stored in a computer frequently need to be checked
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 14:30
Norder to receive financial aid at his vocational school, mario must fill out the fafsa. the fafsa is a form that must be completed to determine . in order to complete a fafsa, you must submit . the fafsa can students obtain
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 19:50
Which feature is selected to practice and save the timing of a presentation
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 21:00
Uget brainliest if accurate mary has been given the responsibility of hiring a person for the position of a software testing officer. which management function would mary achieve this responsibility?
Answers: 1
You know the right answer?
If a filesystem has a block size of 4096 bytes, this means that a file comprised of only one byte wi...
Questions
![question](/tpl/images/cats/geografiya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 19.08.2019 17:30
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 19.08.2019 17:30
![question](/tpl/images/cats/fizika.png)
![question](/tpl/images/cats/himiya.png)
Chemistry, 19.08.2019 17:30
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 19.08.2019 17:30
![question](/tpl/images/cats/himiya.png)
Chemistry, 19.08.2019 17:30
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/es.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/es.png)
Spanish, 19.08.2019 17:30
![question](/tpl/images/cats/mat.png)
Mathematics, 19.08.2019 17:30
![question](/tpl/images/cats/biologiya.png)
Biology, 19.08.2019 17:30
![question](/tpl/images/cats/en.png)