Maximum and minimum values in a list

lst = [12,13,14,16,17,18]

max = lst[1]
min = lst[1]

for i in lst:
if i>max:
max = i
if i<min:
min = i

print(“maximum value is:”,max)
print(“minimum value is:”,min)

1 Like

Well done, Keep it up…

@ankitmchandak Try to use elif instead of two if statements that will be better :+1: