surya k wrote: > This is a project Euler puzzle. http://projecteuler.net/problem=30 > I applied brute force way and here is my codek=0for p in range(1,10): > for q in range(0,10): for r in range(0,10): > for s in range(0,10): > for t in range(0,10): > n = (p*10000)+ (q*1000) + (r*100) + (s*10) + (t*1) > if n == p**5 + q**5 + r**5 + s**5 + t**5: > k+=nprint kMy answer:
Suraya, you did it again. Your python code is formatted into a complete mess. If you don't follow Wayne's advice and post readable plaintext you'll consume a lot of goodwill quickly. > 240559But its showing the answer as wrong!!. I used the same method on the > example puzzle and it worked. Hint: you assume that all partial results have 5 digits, but they may have fewer or more. For example you are missing >>> 4**5+1**5+5**5+0**5 4150 _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor