Im currently working on a project for my coding class. The prompt is to make an atm interface.
All of my code is currently working but when it comes to the function of deposit() it asks for a whole number to be entered where I use int(input) say someone inputs a float like 45346.4 it comes up with an error. Is there a fix to this?
here is my code currently for the deposit function. The balance is already given outside of this function.
def deposit():
balanced = balance
print(f'Your current balance is ${balanced}\n------------------------------')
print('How much money would you like to deposit?\n---------------------------\n You can only deposit in whole numbers')
deposit_amount = int(input('Enter here:'))
if deposit_amount.is_integer():
balance_a_d = balanced + deposit_amount
print(f'You Current Balance is ${balance_a_d}\n-------------------------------\nHave a great day!')
quit()
else:
print('----------------------------\nThat is not a whole number please try again\n----------------------------')
deposit()