<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-tab-span" style="white-space:pre"> </span><font size="4">I am new to programming but have been seriously been bitten by the buy and I am working with the book Python for Dummies by Stef Maruch and Aahz Maruch. I am working on a coin toss program which is suppose to be something like<span style="font-family: Menlo; "> MY issue is that when I try to use the else or elif function it comes back as </span>SyntaxError: invalid syntax and search as I might I can' t seem to find help to address this one issue. And I was hoping you guys can lead me someplace to solve this. I am using Python 3.3.2 on a Mac.</font><div><font size="4"><span class="Apple-tab-span" style="white-space:pre"> </span>Yours Truly </font></div><div><font size="4"><span class="Apple-tab-span" style="white-space:pre"> </span>Roman</font></div><div><font size="4"><span style="font-family: Menlo; color: rgb(4, 51, 255); "><br></span></font></div><div><font size="4"><span style="font-family: Menlo; color: rgb(4, 51, 255); ">import</span><span style="font-family: Menlo; "> random<span class="Apple-tab-span" style="white-space:pre"> </span></span></font><br><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">userinput = ' '</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(180, 38, 26); "><span style="color: #0433ff">print</span><span style="color: #000000"> </span>"Now tossing a coin "</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><span style="color: #0433ff">while</span> userinput.lower() != <span style="color: #b4261a">"q"</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "> flip = random.choice(['heads', 'tails'])</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "> <span style="color: #0433ff">if</span> flip == 'heads':</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "> headcount+= 1</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(180, 38, 26); "><span style="color: #000000"> </span><span style="color: #0433ff">print</span><span style="color: #000000"> </span>"heads! the number of heads is now %d"<span style="color: #000000"> % tailcount</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "> <span style="color: #0433ff">else</span>:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "> tailcount += 1</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(180, 38, 26); "><span style="color: #000000"> </span><span style="color: #0433ff">print</span><span style="color: #000000"> </span>"tails! the number of tails is now %d"<span style="color: #000000"> % tailcount</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(180, 38, 26); "><span style="color: #000000"> </span><span style="color: #0433ff">print</span><span style="color: #000000"> </span>"press 'Q' to quit"<span style="color: #000000">,</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "> userinput = raw_input(<span style="color: #b4261a">"or another key to toss again:"</span>)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(180, 38, 26); "><span style="color: #000000"> </span><span style="color: #0433ff">print</span><span style="color: #000000"> </span>" the total number of heads:"<span style="color: #000000">, headcount</span></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(180, 38, 26); "><span style="color: #000000"> </span><span style="color: #0433ff">print</span><span style="color: #000000"> </span>"the total number off tails:"<span style="color: #000000">, tailcount</span></div><p style="margin: 0px; font-size: 11px; font-family: Menlo; min-height: 13px; "> <br class="webkit-block-placeholder"></p><div><br></div></div></body></html>