future
is an integer, therefore, it cannot be concatenated with a string. You can do this:
print ('Hi ' + name + 'in the year of ', future, 'you will turn ' + diff)
OR cast int
to str
print ('Hi ' + name + 'in the year of ' + str(future) + 'you will turn ' + diff)
Example:
name = (input('Hi, please enter your name '))
dob = int(input('Hi please enter your DOB '))
today = int(input("Hi please enter today's date "))
future = int(today + 5)
diff = str(future - dob)
print ('Hi ' + name + 'in the year of ', future, 'you will turn ' + diff)
Output:
C:\Users\Documents>py test.py
Hi, please enter your name job
Hi please enter your DOB 1876
Hi please enter today's date 2018
Hi jobin the year of 2023 you will turn 147
Example:
name = (input('Hi, please enter your name '))
dob = int(input('Hi please enter your DOB '))
today = int(input("Hi please enter today's date "))
future = int(today + 5)
diff = str(future - dob)
print ('Hi ' + name + 'in the year of ' + str(future) + 'you will turn ' + diff)
Output:
Hi, please enter your name job
Hi please enter your DOB 1876
Hi please enter today's date 2018
Hi jobin the year of 2023you will turn 147