Цветан обнови решението на 09.03.2012 16:18 (преди почти 13 години)
+def prepare_meal(number):
+ spam = ''
+ eggs = ''
+ meal = ''
+ if (number % 5) == 0:
+ eggs = 'eggs'
+ while (number % 3) == 0:
+ spam = spam + 'spam '
+ number /=3
+ if len(spam):
+ meal += spam
+ if len(eggs):
+ meal += 'and '+eggs
+ else:
+ meal = eggs
+ return meal.rstrip()