<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">> From: suryak@live.com</font><br><font class="Apple-style-span" face="Tahoma">> To: waynejwerner@gmail.com</font><br><font class="Apple-style-span" face="Tahoma">> CC: tutor@python.org</font><br><font class="Apple-style-span" face="Tahoma">> Subject: RE: [Tutor] where I am going wrong?</font><br><font class="Apple-style-span" face="Tahoma">> Date: Wed, 14 Dec 2011 19:59:24 +0530</font><br><font class="Apple-style-span" face="Tahoma">></font><br><font class="Apple-style-span" face="Tahoma">></font><br><font class="Apple-style-span" face="Tahoma">></font><br><font class="Apple-style-span" face="Tahoma">></font><br><font class="Apple-style-span" face="Tahoma">> ________________________________</font><br><font class="Apple-style-span" face="Tahoma">> > From: waynejwerner@gmail.com</font><br><font class="Apple-style-span" face="Tahoma">> > Date: Wed, 14 Dec 2011 08:25:53 -0600</font><br><font class="Apple-style-span" face="Tahoma">> > Subject: Re: [Tutor] where I am going wrong?</font><br><font class="Apple-style-span" face="Tahoma">> > To: suryak@live.com</font><br><font class="Apple-style-span" face="Tahoma">> > CC: tutor@python.org</font><br><font class="Apple-style-span" face="Tahoma">> ></font><br><font class="Apple-style-span" face="Tahoma">> > On Wed, Dec 14, 2011 at 8:13 AM, surya k</font><br><font class="Apple-style-span" face="Tahoma">> > <suryak@live.com<mailto:suryak@live.com>> wrote:</font><br><font class="Apple-style-span" face="Tahoma">> ></font><br><font class="Apple-style-span" face="Tahoma">> > This is a project Euler</font><br><font class="Apple-style-span" face="Tahoma">> > puzzle. http://projecteuler.net/problem=30<http://projecteuler.net/problem%3d30></font><br><font class="Apple-style-span" face="Tahoma">> > I applied brute force way and here is my code</font><br><font class="Apple-style-span" face="Tahoma">> > 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">> > range(0,10): for s in range(0,10): for t in</font><br><font class="Apple-style-span" face="Tahoma">> > range(0,10): n = (p*10000)+ (q*1000) + (r*100) + (s*10)</font><br><font class="Apple-style-span" face="Tahoma">> > + (t*1) if n == \ p**5 + q**5 +</font><br><font class="Apple-style-span" face="Tahoma">> > r**5 + s**5 + t**5: print n</font><br><font class="Apple-style-span" face="Tahoma">> > k+=nprint k</font><br><font class="Apple-style-span" face="Tahoma">> > My answer: 240559</font><br><font class="Apple-style-span" face="Tahoma">> > But its showing the answer as wrong!!.</font><br><font class="Apple-style-span" face="Tahoma">> > I used the same method on the example puzzle and it worked.</font><br><font class="Apple-style-span" face="Tahoma">> ></font><br><font class="Apple-style-span" face="Tahoma">> > Your email client broke the formatting - you should probably use</font><br><font class="Apple-style-span" face="Tahoma">> > plain-text or a pastebin.</font><br><font class="Apple-style-span" face="Tahoma">> ></font><br><font class="Apple-style-span" face="Tahoma">> > -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. </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): </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); "> for q in range(0,10): </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); "> for r in range(0,10): </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); "> for s in range(0,10): </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); "> for t in range(0,10): </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); "> n = (p*10000)+ (q*1000) + (r*100) + (s*10) + (t*1) </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); "> if n == p**5 + q**5 + r**5 + s**5 + t**5: </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); "> </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); "> 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: 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>