Whats wrong in this getting wrong o/p that min is 4. input is- 7,2,bob,10,4 | Coursera Community
Coursera Header
Question

Whats wrong in this getting wrong o/p that min is 4. input is- 7,2,bob,10,4


Badge +1

max=0.0
min=0.0
while True :
    sval= input('Enter A No:')
    if sval=='done' :
        break
    try:
        ival=int(sval)
    except:
        print('Invalid input')
        continue
    if ival > max :
        max = ival
    elif min < ival:
        min = ival
print('Maximum is',max)
print('Minimum is',min)


3 replies

Userlevel 5
Badge +4

@sudipp007 

 

Post on the Computer science discussion forum.

Badge

your code is not working bro

 

Badge +1

your code is not working bro

 

I know something is not working that’s why I posted that. can you please find the error? 

Reply