Skip to content
Extraits de code Groupes Projets
Valider 4d2b4024 rédigé par fbury's avatar fbury
Parcourir les fichiers

Few corrections on chapter 4

parent 704efcec
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
def is_perfect(number):
if type(number)==float:
print("Warning, {0} is a float. The function will consider it to be {1} instead.".format(number,int(number+0.5)))
number = int(number+0.5)
elif type(number) != int:
if isinstance(number,float):
print("Warning, {0} is a float. The function will consider it to be {1} instead.".format(number,round(number)))
number = round(number)
elif not isinstance(number,int):
print("Error, cannot understand the user input : {0}".format(number))
return False
sum_div = 0
for div in range(1,number+1):
if number%div == 0:
......
......@@ -54,3 +54,4 @@ def date_format(date, dformat = "dd/mm"):
return ""
return french_date(day, month)
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter