Николай обнови решението на 12.03.2012 23:59 (преди почти 13 години)
+def prepare_meal(number):
+ output = ' '
+ occurances = False
+ if number % 3 == 0:
+ occurances = [n for n in range(1, number) if number % 3 ** n == 0]
+ output = "spam " * occurances[-1]
+ output = output[0:-1]
+ if number % 5 == 0:
+ if occurances:
+ output += ' and eggs'
+ else:
+ output += 'eggs'
+ return output