Home > other >  Strives for the bosses of the new online
Strives for the bosses of the new online

Time:09-28


Using IDLE write a Python program, the user from the keyboard input three integers, realize the ascending order of the three integers,

CodePudding user response:

 
Def int_sort () :
ListInt=[]
ICount=0
While True:
If iCount==3:
Break
N=(input (' please enter the first + STR (iCount + 1) + 'integers exit and calculate the total (q) :'))
If n.u pper ()=='Q:
Break
Try:
If the type (eval (n))==float:
Print (" please enter an integer! ')
Elif type (eval (n))==int:
ListInt. Append (int (n))
ICount +=1
Except:
Print (" please enter an integer! ')

ListInt. Sort ()
Print (listInt)

Int_sort ();

CodePudding user response:

Will be subject to this:

 
Def int_sort () :
ListInt=[]
ICount=0
While True:
If iCount==3:
Break
N=(input (' please enter the first + STR (iCount + 1) + 'integers:'))
# if n.u pper ()=='Q' :
# break
Try:
If the type (eval (n))==float:
Print (" please enter an integer! ')
Elif type (eval (n))==int:
ListInt. Append (int (n))
ICount +=1
Except:
Print (" please enter an integer! ')

ListInt. Sort ()
Print (listInt)

Int_sort ();

CodePudding user response:

He told me that the identifier in the invalid characters
  • Related