[Tutor] Extremely simple question

Noah Hall enalicho at gmail.com
Wed Jan 11 08:24:24 CET 2012


On Wed, Jan 11, 2012 at 7:14 AM, Chris Johnson <c.johnsonbl at gmail.com> wrote:
> Hi there,
>
> I am *new* (I cannot put enough emphasis on that!) to Python programming,
> and to programming in general. I am trying to write out a statement that
> will protect a file on my computer from being run unless I enter the right
> specifications;
>
>> your_weight = int(raw_input("Please enter your weight: "))
>> if your_weight < 0:
>> print 'You're not Chris!'
>> elif your_weight == 170:
>> print 'You might be Chris! But...'
>> your_height = int(raw_input("Please enter your height: "))
>> if your_height < 180:
>> print 'You're not Chris!
>> elif your_height == 180:
>> print 'You're Chris!'
>> your_name = int(raw_input("What is your name? "))
>> elif your_height > 180:
>> print 'You're not Chris!"
>> elif x > 170:
>> print 'You're not Chris!'
>
>
> When I open it, the program says I have a syntax error. Praytell, where did
> I go wrong?

When you have a problem like this, you should copy and paste the
*whole* traceback here. Anyway, just from quickly looking, I think
your error lines in the the line

elif x > 170:

I'm sure you can work out why.


More information about the Tutor mailing list