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

22nd Jan 2022, 1:29 AM
Lenoname
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")
22nd Jan 2022, 2:45 AM
NEZ
NEZ - avatar
+ 1
You missed the indentation. This is critical in Python. Review the lessons on indentation - this is very important.
22nd Jan 2022, 3:26 AM
Emerson Prado
Emerson Prado - avatar
0
ㅀㅀㅀ Pls avoid giving finished code. Instead, prefer explaining how to fix, so the OP can do it him/herself, then learn for real.
23rd Jan 2022, 11:25 PM
Emerson Prado
Emerson Prado - avatar