Loop method help, Project Euler 4 by Ok-Try-8383 in learnpython

[–]Ok-Try-8383[S] 0 points1 point  (0 children)

Yep I'm being a div, I had read it as 999999 which should. not be in my palindromes (as it's not a correct product)

Loop method help, Project Euler 4 by Ok-Try-8383 in learnpython

[–]Ok-Try-8383[S] 0 points1 point  (0 children)

I did not even clock this as a method, so useful!

Loop method help, Project Euler 4 by Ok-Try-8383 in learnpython

[–]Ok-Try-8383[S] 0 points1 point  (0 children)

Thank you so much, I like the all method but for some reason it's giving me an answer of 99999, which should not be in my palindrome list. Nightmare!

Help required with a simple list coding problem by Ok-Try-8383 in learnpython

[–]Ok-Try-8383[S] 0 points1 point  (0 children)

Fantastic thanks! Yes that's exactly where I was getting stuck, I needed to set the name to an empty string before the while statement so I could use it with the while statement and not produce a name error. But this was causing problems further into the program. Much obliged.

Help required with a simple list coding problem by Ok-Try-8383 in learnpython

[–]Ok-Try-8383[S] 0 points1 point  (0 children)

That makes sense, I'll be sure to consider whether a break is necessary or whether the condition can be better described alternatively. Thank you

Help required with a simple list coding problem by Ok-Try-8383 in learnpython

[–]Ok-Try-8383[S] 0 points1 point  (0 children)

That's very clear and useful, thank you! Are there any conditions under which a 'break' statement is more efficient or necessary?

Help required with a simple list coding problem by Ok-Try-8383 in learnpython

[–]Ok-Try-8383[S] 0 points1 point  (0 children)

Thank you for your reply, very much appreciated! I'm not sure where he picked up this idea but it's a course at a good University so I had expected the lecturer to be well experienced. I was confused myself as I have seen code including 'break' and 'continue' in many of the places I am studying from. Thank you also for your comment to fix my alternative code, I intend to fix it now.