There are several issues in your HTML (minor issues) first:
Declare the html tag as:
<html xmlns="http://www.w3.org/1999/xhtml">
Then, I'd change all your string concatenation by expressions like 'xxx att="%s" xxx' % mysubstr
:
print "<p>Thanks for playing, %s. Your roll:<br/>" % name
print '<img src="dice-%s.gif" alt="%s" width="107" height="107" /></p>' % (str(die1), str(die1))
print "<p>Your opponent's roll:<br/>"
print '<img src="dice-%s.gif" alt="%s" width="107" height="107" /></p>' % (str(die2), str(die2))
if die1 >= die2:
print "<p>You win %s.</p>" % str(bet)
if die1 < die2:
print "<p>You lose %s.</p>" % str(bet)
if die1 == die2:
print "<p>You win %s.</p>" % str(double)
In this way is easier to detect missing "'s. You need them to encapsulate all your html attribute values.
I've test these changes and the output is something like:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Dice Game</title>
</head>
<body>
<h1>Dice Game</h1>
<p>Thanks for playing, Rob. Your roll:<br/>
<img src="dice-3.gif" alt="3" width="107" height="107" /></p>
<p>Your opponent's roll:<br/>
<img src="dice-5.gif" alt="5" width="107" height="107" /></p>
<p>You lose 234.</p>
</body>
</html>
That code passed successfully the W3C validator.
I hope this can help.