0
Retiring
The programme should ask the user about their name then ask them about their age, based on what their age is the programme will calculate how many years later they will retire and tells the user about it, the retiring age in this case is 65. This is what i wrote, is it correct? https://code.sololearn.com/c4oI05pT3QVS/?ref=app
3 Answers
+ 1
None, your code had some indentation errors and you wrote:
...
if age>64: (if age is more than 64)
...
rather do this:
...
if age>=65: (if age is more than than or equal to 65)
...
and take age as integer not as string:
like this:
...
age=int(input())
...
//
here is your edited code:
name = input()
age = int(input())
if age >=65:
print ("you are already retired")
else:
print(65-age, "years until you retire")
+ 1
You missed the indentation. This is critical in Python. Review the lessons on indentation - this is very important.
0
ă
€ă
€ă
€ Pls avoid giving finished code. Instead, prefer explaining how to fix, so the OP can do it him/herself, then learn for real.