Something is wrong with my code?

Post new topic   Reply to topic

View previous topic View next topic Go down

Something is wrong with my code?

Post  whOOper on Sat Apr 18, 2009 9:35 pm

Code:
choice = int(raw_input("What is your age "):
if choice <= 49:
            print "Your not yet old"
elif choice >= 50:
            print "Your old as hell"
else:
            print "Invalid input"

I cant figure out whats wrong with it. It keeps giving me errors I'm not supposed to get please help

whOOper
Moderator
Moderator

Posts: 10
Reputation: 0
Join date: 2009-04-17
Age: 17

View user profile

Back to top Go down

Re: Something is wrong with my code?

Post  Xarver on Sat Apr 18, 2009 10:15 pm

Moved to the Help! forum.
Always remember, if you're asking for help on a language,
ask in the language's help forum Wink

Also, I found the problem in 5 seconds.
Look at this line:
Code:
choice = int(raw_input("What is your age "):

You obviously put : instead of )

Observe your code a bit before you post. Smile

Xarver
Admin
Admin

Posts: 32
Reputation: -1
Join date: 2009-04-17
Location: Somewhere

View user profile http://codegreen.gooforums.com

Back to top Go down

Re: Something is wrong with my code?

Post  TheFellow on Sun Apr 19, 2009 4:37 am

It is a common mistake, most other languages has syntax like that: if(TheFellow = UsingC){(Laugh);}

TheFellow
Forum Regular
Forum Regular

Posts: 26
Reputation: 0
Join date: 2009-04-18
Location: CyberSpace

View user profile http://revware.comuf.com

Back to top Go down

View previous topic View next topic Back to top


Post new topic   Reply to topic
Permissions of this forum:
You cannot reply to topics in this forum