Hi Everyone,
I am new to Python and programming in general. I bought the book Python
Programming for the Absolute Beginner by michael Dawson.
I have been working through it but am having trouble.
I am trying to make a coin flip program and keep geting a Synax Error
invalid syntax.
If anyone
Chad,
The usage is like this:
- if cond1:
- block 1
- elif cond2:
- block 2
- else:
- block 3
So, your code should be:
if tries == 1:
elif tries == 2:
(You have 'else' followed by a condition...hence a syntax error. else
is what it means - if no other condition is
Chad Everett wrote:
Hi Everyone,
I am new to Python and programming in general. I bought the book
Python
Programming for the Absolute Beginner by michael Dawson.
I have been working through it but am having trouble.
I am trying to make a coin flip program and keep geting a Synax Error
Le Fri, 4 Feb 2005 12:49:51 -0600, Chad Everett a écrit :
Hi Everyone,
I am new to Python and programming in general. I bought the book Python
Programming for the Absolute Beginner by michael Dawson.
I am trying to make a coin flip program and keep geting a Synax Error
invalid syntax.
Chad,
try elif tries == 2 or just else:. You are not allowed to put an
expression after an else statement.
I recommend you read the python tutorial at
http://docs.python.org/tut/tut.html .
Peace
Bill Mill
bill.mill at gmail.com
On Fri, 4 Feb 2005 12:49:51 -0600, Chad Everett [EMAIL PROTECTED]
Chad Everett wrote:
Hi Everyone,
I am new to Python and programming in general. I bought the book
Python
Programming for the Absolute Beginner by michael Dawson.
I have been working through it but am having trouble.
I am trying to make a coin flip program and keep geting a Synax Error