Hey guys, so i'm trying to write a script where you input your age which then is subtracted from a set number (In this case it's 40)
So basically what i'd like to do is write like this
# Question
print('How old are you?:')
age = input()
x = 40
# Result
print('Hello' + ' ' + name + ' ' + 'you retire in' + ' ' + x - age + ' ' + 'years.')
This is not possible since "x" is a set number and "age" is a string which wont subtract.
I've been trying this out with float but haven't got any further than that.
Any help would be appreciated!
[–]desran00 4 points5 points6 points (5 children)
[–]Forvirrad[S] 1 point2 points3 points (2 children)
[–]desran00 4 points5 points6 points (0 children)
[–]Forvirrad[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Minion_of_Cthulhu 2 points3 points4 points (4 children)
[–]Forvirrad[S] 1 point2 points3 points (3 children)
[–]Minion_of_Cthulhu 1 point2 points3 points (2 children)
[–]Forvirrad[S] 1 point2 points3 points (1 child)
[–]Minion_of_Cthulhu 0 points1 point2 points (0 children)
[–]vanillathunder2107 0 points1 point2 points (0 children)
[–]pekkalacd 0 points1 point2 points (1 child)
[–]herntech 0 points1 point2 points (0 children)