Николай обнови решението на 15.03.2012 17:09 (преди почти 13 години)
+def prepare_meal(number):
+ dev_by_three = number
+ message = ""
+
+ if not number % 3 == 0 and not number % 5 == 0:
+ return message
+
+ while dev_by_three % 3 == 0:
+ message += "spam"
+ dev_by_three /= 3
+ if dev_by_three % 3 == 0:
+ message += " "
+
+ if number % 5 == 0:
+ if not number % 3 == 0:
+ message += "eggs"
+ else:
+ message += " and eggs"
+
+ return message