mirror of
https://github.com/arthur-pbty/nsi.git
synced 2026-06-03 23:36:19 +02:00
Exercise 1.1 update
This commit is contained in:
@@ -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")
|
||||
Reference in New Issue
Block a user