Project euler problem 151

For questions about problems on the Project Euler web site. No spoilers. Please include the question number in the subject line of your post.

Project euler problem 151

Postby DaKring » Thu Oct 09, 2014 8:55 am

What i posted below is a python program to solve project euler problem 151. Since I am very new to python it would be great if someone could explain what happens in each line of code. We understand what is supposed to happen in the program but we don't understand what each line does. All help is greatly appreciated!

Code: Select all
Last edited by micseydel on Thu Oct 09, 2014 3:48 pm, edited 2 times in total.
Reason: yoriz: First post lock, Added code tags. micseydel: removed spoiler code.
Posts: 1
Joined: Thu Oct 09, 2014 8:52 am

Re: Project euler problem 151

Postby Baldyr » Thu Oct 09, 2014 3:41 pm

What lines or code constructs are causing you to scratch your head? (No, not gonna comment every single line.)

As a general suggestion you should probably read up on Python, rather than stare at some sample code. Because the latter is actually the long way, not the short-cut you were looking for.

Welcome to the forums, your journey into Python has begun! :D
User avatar
Posts: 523
Joined: Thu Aug 14, 2014 4:15 pm

Re: Project euler problem 151

Postby micseydel » Thu Oct 09, 2014 3:51 pm

Besides seconding Baldyr's comments, I've removed your spoiler code and move this topic to the Project Euler section, which has these rules.
Due to the reasons discussed here we will be moving to on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
Posts: 3000
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Return to Project Euler

Who is online

Users browsing this forum: No registered users and 1 guest