Write a program that reads numbers entered and then returns the total, help pls

Question:

Can someone help me pls? i need to write a program that reads numbers entered and then return the total without using ‘for’ or ‘while’ and i have no idea how to do it:(

n = 0
count = 0 # `enter code here`
user = input('Enter Numbers:n> ')
while user != 'done':
    try:
        n = n + float(user)
    except:
        print('Enter Numbers or "done"')
    user = input('> ')
    count = count + 1
    if user == 'done':
        print('Total:',n)

# this works for me but i need to do it without using loops like 'for' or 'while' :( 
Asked By: German Fmz

||

Answers:

numbers = []
def loop():
    n = input('Enter Numbers or done:n>')
    if n == 'done':
        print('Total:', sum(numbers))
    else:
        numbers.append(int(n))
        loop()
loop()
Answered By: AspiraDev
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.