so I'm fairly new to python or coding in general and was wondering if anyone can help me with this code of mine i'm doing as homework. So, what I'm trying to do is when I type a negative number, I don't want the negative number to compute but I don't know how to go on about it.
Atm, still currently trying to figure out what loops or what not to actually cancel out the negative numbers but my dumbself can't seem to get it :l
totalSum = 0
n = 0
avg = 0
n = int(input('How many numbers you wish to enter? '))
for i in range(n):
num = eval(input('Enter any number: '))
if num < 0:
break
totalSum += num
avg = totalSum / n
print('Total: ', totalSum, '| ' 'Average: ', avg)