Money=input (' please enter your monthly salary: '). The strip ()
If money. Isdecimal () :
Money=float (money)
If money & gt; 10000:
Print (' champagne ')
The else:
Print (' wash your sleep)
The else:
Print (' your input is not correct)
CodePudding user response:
Should be isdecimal () does not include the decimal point, so the first step is judged to be False,Directly with the try to keep it simple: float (money), if error will re-enter,
Or just use regular expressions to determine whether money meets the requirements,