min() and max() give error: TypeError: 'float' object is not iterable
Posted
by
PythonUser3.3
on Stack Overflow
See other posts from Stack Overflow
or by PythonUser3.3
Published on 2013-11-02T23:17:22Z
Indexed on
2013/11/03
3:54 UTC
Read the original article
Hit count: 300
python-3.x
markList=[]
Lmark=0
Hmark=0
while True:
mark=float(input("Enter your marks here(Click -1 to exit)"))
if mark == -1: break
markList.append(mark)
markList.sort()
mid = len(markList)//2
if len(markList)%2==0:
median=(markList[mid]+ markList[mid-1])/2
print("Median:", median)
else:
print("Median:" , markList[mid])
Lmark==(min(mark))
print("The lowest mark is", Lmark)
Hmark==(max(mark))
print("The highest mark is", Hmark)
My program is a basic grade calculator using lists. My program asks the user to input their grades into a list in which it then calculates your average and finds your lowest and highest mark. I have found the average but I can't seem to figure out how to find the lowest and highest grade. Can you please show me pr tell me what to do?
© Stack Overflow or respective owner