Светлин обнови решението на 10.03.2012 21:26 (преди почти 13 години)
+def prepare_meal(number):
+ copy_of_number = number
+ output=''
+ while number%3 == 0 and number != 0:
+ number = number / 3
+ if number%3 != 0:
+ output = output + 'spam'
+ else:
+ output = output + 'spam '
+
+ if number%5 == 0:
+ if copy_of_number != number:
+ output = output + ' and eggs'
+ else:
+ output = output + 'eggs'
+
+ return output
+