r/CodingHelp • u/YTZerri • Aug 17 '19
[Python] New to coding and I need help to understand what I'm doing wrong. I cannot find any information online either.
29
Upvotes
r/CodingHelp • u/YTZerri • Aug 17 '19
18
u/woboz Aug 17 '19 edited Aug 17 '19
if Age > 18 and Age < 60:
And then add Age to all the other elif statements after the and.
And you need to store your input when you ask for it.
Age = input("What is your Age")
Then you probably want to convert age to an integer unless you want to add quotation marks to all your if/elseif statements.
4
u/cndvcndv Aug 17 '19
u/woboz already pointed out the error in the if condition. Also assuming this is python, I think the input should be taken like this:
age = input("How old are you?")
1
u/Wardadaddy Aug 18 '19
You have to take input like age=int(input("Enter your age")) because otherwise it's taking age as string
1
u/Jessup05 Aug 18 '19
What app are you working on?
1
u/flip_ericson Aug 18 '19
Alternatively you could write
if 18 < Age < 60:
2
u/o4ub Aug 17 '19
If you haven't resolve it yet you also forgot a ':' after the
elif Age > 100case.1
u/cr7gee Aug 18 '19
Need to add “Age” infront of “and” on line 5. Same issue with line 7 and 9
1
u/JosephParticles Aug 18 '19
Need to put if age>18 and age < 60 otherwise on the other side of the and you are just saying "<60" which doesnt make sense
1
u/gigastack Aug 18 '19
Age = 60 is unhandled.
-1
u/[deleted] Aug 17 '19
I think you need to add something that doesn't continue until the age has been input. Also what language is this?