<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
<br><br><font class="Apple-style-span" face="Tahoma">----------------------------------------</font><br><font class="Apple-style-span" face="Tahoma">&gt; From: suryak@live.com</font><br><font class="Apple-style-span" face="Tahoma">&gt; To: waynejwerner@gmail.com</font><br><font class="Apple-style-span" face="Tahoma">&gt; CC: tutor@python.org</font><br><font class="Apple-style-span" face="Tahoma">&gt; Subject: RE: [Tutor] where I am going wrong?</font><br><font class="Apple-style-span" face="Tahoma">&gt; Date: Wed, 14 Dec 2011 19:59:24 +0530</font><br><font class="Apple-style-span" face="Tahoma">&gt;</font><br><font class="Apple-style-span" face="Tahoma">&gt;</font><br><font class="Apple-style-span" face="Tahoma">&gt;</font><br><font class="Apple-style-span" face="Tahoma">&gt;</font><br><font class="Apple-style-span" face="Tahoma">&gt; ________________________________</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; From: waynejwerner@gmail.com</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; Date: Wed, 14 Dec 2011 08:25:53 -0600</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; Subject: Re: [Tutor] where I am going wrong?</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; To: suryak@live.com</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; CC: tutor@python.org</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt;</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; On Wed, Dec 14, 2011 at 8:13 AM, surya k</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; &lt;suryak@live.com&lt;mailto:suryak@live.com&gt;&gt; wrote:</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt;</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; This is a project Euler</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; puzzle. http://projecteuler.net/problem=30&lt;http://projecteuler.net/problem%3d30&gt;</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; I applied brute force way and here is my code</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; k=0for p in range(1,10): for q in range(0,10): for r in</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; range(0,10): for s in range(0,10): for t in</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; range(0,10): n = (p*10000)+ (q*1000) + (r*100) + (s*10)</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; + (t*1) if n == \ p**5 + q**5 +</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; r**5 + s**5 + t**5: print n</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; k+=nprint k</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; My answer: 240559</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; But its showing the answer as wrong!!.</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; I used the same method on the example puzzle and it worked.</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt;</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; Your email client broke the formatting - you should probably use</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; plain-text or a pastebin.</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt;</font><br><font class="Apple-style-span" face="Tahoma">&gt; &gt; -Wayne</font><br><br><br><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">This is a project Euler puzzle.&nbsp;</span><a href="http://projecteuler.net/problem%3d30" target="_blank" style="line-height: 17px; color: rgb(0, 104, 207); cursor: pointer; font-family: Tahoma, Verdana, Arial, sans-serif; background-color: rgb(255, 255, 255); ">http://projecteuler.net/problem=30</a><br style="line-height: 17px; color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; background-color: rgb(255, 255, 255); "><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">I applied brute force way and here is my code</span><br style="line-height: 17px; color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; background-color: rgb(255, 255, 255); "><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">k=0</span><div style="font-family: Tahoma; "><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">for p in range(1,10):&nbsp; &nbsp;&nbsp;</span></div><div style="font-family: Tahoma; "><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">&nbsp; &nbsp; for q in range(0,10):&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></div><div style="font-family: Tahoma; "><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for r in range(0,10):&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></div><div style="font-family: Tahoma; "><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for s in range(0,10):&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span></div><div style="font-family: Tahoma; "><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for t in range(0,10):&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></div><div style="font-family: Tahoma; "><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n = (p*10000)+ (q*1000) + (r*100) + (s*10) + (t*1)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></div><div style="font-family: Tahoma; "><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if n == &nbsp;p**5 + q**5 + r**5 + s**5 + t**5: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></div><div style="font-family: Tahoma; "><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; k+=n</span></div><div style="font-family: Tahoma; "><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); "><br></span></div><div style="font-family: Tahoma; "><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">print k</span></div><div style="font-family: Tahoma; "><br style="line-height: 17px; color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; background-color: rgb(255, 255, 255); "><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">My answer:&nbsp;240559</span></div><div style="font-family: Tahoma; "><br style="line-height: 17px; color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; background-color: rgb(255, 255, 255); "><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">But its showing the answer as wrong!!.</span></div><div style="font-family: Tahoma; "><br style="line-height: 17px; color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; background-color: rgb(255, 255, 255); "><span class="Apple-style-span" style="color: rgb(42, 42, 42); font-family: Tahoma, Verdana, Arial, sans-serif; line-height: 17px; background-color: rgb(255, 255, 255); ">I used the same method on the example puzzle and it worked.</span></div>                                               </div></body>
</html>