0
What is bug in this code?
l= "none" s="none" while True: n=input("enter the value: ") if n=='done': break try: f=float(n) except: print("invalid input") if l is "none "or n>l: l=n elif s is "none"or n<s: s=n print("Max is",l) print("Min is ",s) """ 7,2,bob,10,4 are given as input and output should be : invalid input Max is 10 Min is 2 """
4 Answers
0
Try to write the try and except blocks in else part and modify your code using the conditional statements... You didn't used them correctly I think..try to modify the code by keeping the conditional statements correctly..
0
n is not equals to none if you enter a value of integer
0
but you write int(input
0
we cannot change a letter to float