fromdecimalimportDecimaldefpay(amount:Decimal)->str:drink={2.2:'Americano',2.3:'Latte',2.4:'Flat white',3.5:'Filter'}.get(amount)error_message='Sorry, exact change only, try again tomorrow!'success_message=f'Here is your {drink}, have a nice day'returnerror_messageifnotdrinkelsesuccess_message
Remember, always use decimal for currency
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Python solution