generate functionWed, 22 Feb 2023

the total sum of integers entered on a new line must not exceed 'n'. before the sum exceeds for one input before exceeding it is necessary to print the word 'enough' and the sum of the input chichel and the number of numbers

n = int(input()) sum_ = 0 i = 0 while sum_ < n: x = int(input()) sum_ += x i += 1 if sum_ >= n: break print('sum:', sum_) print('number of numbers:', i)

Want to kickstart your project?Use the new AI Studio to create your code