I tried this code to output 5% as a tax.
income = input('How much is your income?')
tax = income / 20
print('The tax would be ' + tax )
Why does it not work this way?
It gave me an error.
I tried this code to output 5% as a tax.
income = input('How much is your income?')
tax = income / 20
print('The tax would be ' + tax )
Why does it not work this way?
It gave me an error.
input
returns a string by default. You need to manually cast it to an int or float like so:
income = float(input('How much is your income?'))