While taking an Intro to Python course through Plural Sight, I found that the code that worked for me was different than that of the instructor. (Different version?) There is one difference I do not understand. Why does the input function sometimes require an int or a float, but at other times it crashes with it? Here are some examples that only work this way:
AGE CALCULATOR
age = input("How old are you?\n")
decades = int(age) // 10 years = int(age) % 10
LOAN CALCULATOR
money_owed = float(input("How much money do you own, in dollars?\n")) # 50,000
apr = float(input('What is the annual percentage rate?\n')) # 3.0
payment = float(input('What will your monthly payment be, in dollars?\n')) # 1,000
months = int(input('How many months do you want to see results for? \n')) # 24
but at other times it crashes with itwhat is "it"? Please provide a minimal reproducible example of your issue. And is this line correct? Seems like it's two lines combined:decades = int(age) // 10 years = int(age) % 10input. This was changed in Python 3.age = int(input("How old are you?"))and then not need to useint(age)inside the next line.//be a valid operator? I thought that was introduced with 3.