lst = []
num = int(input('How many people?: '))
for n in range(num):
age = float(input('Input Age: ')
seconds = str(age*31536000)
print("You lived: ", seconds)
lst.append(age)
print("Highest age: ", max(lst), "\n Least aged: ", min(lst))
I don't know why this doesnt work, any help appreciated.
You forgot to close the parenthesis on line 4. lst.append
and the print statement before it should probably be in the loop (Credit: Luke Nelson). Here's the fixed code:
lst = []
num = int(input('How many people?: '))
for n in range(num):
age = float(input('Input Age: '))
seconds = str(age*31536000)
print("You lived: ", seconds)
lst.append(age)
print("Highest age: ", max(lst), "\n Least aged: ", min(lst))