Q. Write a short program to find largest number of the list of number entered through keyboard.


You can understand by Watching video :-



Answer :-

b = 0
while True :
    a = int(input("Enter a number (for quit enter 0 (zero) )= "))
    if a == 0 or a == 0 :
        break
    else :
        if a  > b :
            b = a
print(b, "is biggest number.")

Output :-

Enter a number (for quit enter 0 (zero) )= 5
Enter a number (for quit enter 0 (zero) )= 4
Enter a number (for quit enter 0 (zero) )= 9
Enter a number (for quit enter 0 (zero) )= 7
Enter a number (for quit enter 0 (zero) )= 31
Enter a number (for quit enter 0 (zero) )= 14
Enter a number (for quit enter 0 (zero) )= 85
Enter a number (for quit enter 0 (zero) )= 693
Enter a number (for quit enter 0 (zero) )= 45
Enter a number (for quit enter 0 (zero) )= 20
Enter a number (for quit enter 0 (zero) )= 0
693 is biggest number.

>>>

9 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post