Рая обнови решението на 14.03.2012 22:27 (преди почти 13 години)
+def prepare_meal(number):
+ work_number = number
+ final_string = ''
+ running = True
+ while running:
+ if (work_number % 3) == 0:
+ final_string += 'spam '
+ work_number /= 3
+ else:
+ running = False
+ if (number % 5) == 0:
+ if not final_string == '':
+ final_string += 'and '
+ final_string += 'eggs'
+ return final_string.strip()