Hello, I have python as one of my 2nd semester chairs and I need a little help. I have an exercise where I can not make it work correctly; here is the statement: "Write a program that will read from the keyboard a set of numbers until the user enters a negative number. At the end you should print the largest of these numbers." The following code was what I did but as I said above, it does not work correctly.
def read():
list=[]
n = int(input("Introduza um nº negativo para terminar:"))
while True:
if n > 0:
n = int(input("Introduza um nº negativo para terminar:"))
list.append(n)
else:
break
print("O maior nº é:"+max(list))
read ()