Write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print out the largest and smallest of the numbers.

''' user can enter values many times. If user wants to stop finding minimum and maximum then please enter done ''' 

while(1):   '''  loops runs '''

    n1=input('Enter first no: ')   ''' Accept number from user '''

    if n1=='done':   '''  if user enter done while loop breaks otherwise it will ask 2nd number '''

        print('Good Bye........')

        break

    else:

        n2=input('Enter second no: ')

        print(' largest  no is: ')

        print(max(n1,n2))  ''' max is use to find miximum between 2 numbers '''

        print(' smallest  no is: ')

        print(min(n1,n2))   ''' min is use to find minimum between 2 numbers '''

0 Comments