Илия обнови решението на 14.03.2012 17:06 (преди почти 13 години)
+#!/usr/bin/python
+
+
+def prepare_meal(number):
+ data = number
+ str = ""
+ if number >= 3 and not number % 3:
+ str = "spam"
+ number = number / 3
+ while number >= 3 and not number % 3:
+ str += " spam"
+ number = number / 3
+ if data != number and not number % 5:
+ str += " and"
+ if data == number and not number % 5:
+ str += "eggs"
+ number = number / 5
+ while number >= 5 and not number % 5:
+ str += " eggs"
+ number = number / 5
+ return str