Exercise 1.1 update

This commit is contained in:
Tutur33
2023-11-28 22:21:53 +01:00
parent 5dbad5630f
commit ab8dff4fa6
+12 -2
View File
@@ -1,2 +1,12 @@
fichier = 536
print("Fichier :", fichier, "kio", fichier * 2**10, "octets",fichier * 8 * 2**10, "bits")
# Display the size in bytes and bits of a 536 kio file.
# 1 kio (1 kibioctet) = 210 bytes
# 1 byte = 1 byte = 8 bits
bool = True
while bool:
try:
fichier = int(input("What is the size of your file in kio ? "))
print("Fichier :", fichier, "kio", "=", fichier * 2**10, "octets", "=", fichier * 8 * 2**10, "bits")
bool = False
except:
print("You had to enter a number. Example: 536")