Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

I suck, need some guidance!!!!!!!

hey guys,
I was just sitting around trying to figure something to do and so I just opened my laptop and started searching something and suddenly I came to this project Euler to try out some problems with python. Guys, I wasn't able to solve neither of those problems I went over first 3 that's probably the easiest ones and I suck seriously not even one and this is getting my moral down a lot, I was thinking of getting into computer science in college but here it seems that I think I should change my mind.

Any comments and help or guidance is highly appreciated.
Project Euler is for people who have learned the intricacies of their language and want to work on problem solving. The problems are designed to be easy to brute force, but impractical to do so. One way to tackle them is to make a brute force solution and then try to find ways to improve your program little by little. For example, here is my solution to the third problem: http://codepad.org/63OIkrWA

As you may be able to tell, I started by going through all of the numbers and checking if it was both prime and a factor of the input number. This took a long time but worked. Next, I noticed that since I'm looking for the largest factor, I can greatly reduce the amount of time my program needs by checking not only the number I come across, but also the other part of the factor (i.e. in a*b = c, if c is my input and a is a small factor, b is a large factor). I'm sure I could make it faster if I spent more time on it, but this was more than fast enough for me to consider it elegant.

Just remember that these problems start really hard and get even harder. Don't be disheartened if you can't figure them out immediately.
Pick up a book, there are plenty of good python resources out on the internet to learn from.
well sir I already python I have already written several programs with it now I was thinking of going into deep that is want to learn C and get into the Linux drivers programming and kernel programming so I was like demotivated because if I am not able to solve these problems how will I go manage the whole memory management or write kernel modules with C, so just wanted to know am I ok or will I have to leave programming.

(Oct 7, 2013 03:35 PM)monkeytherat Wrote:  Project Euler is for people who have learned the intricacies of their language and want to work on problem solving. The problems are designed to be easy to brute force, but impractical to do so. One way to tackle them is to make a brute force solution and then try to find ways to improve your program little by little. For example, here is my solution to the third problem: http://codepad.org/63OIkrWA

As you may be able to tell, I started by going through all of the numbers and checking if it was both prime and a factor of the input number. This took a long time but worked. Next, I noticed that since I'm looking for the largest factor, I can greatly reduce the amount of time my program needs by checking not only the number I come across, but also the other part of the factor (i.e. in a*b = c, if c is my input and a is a small factor, b is a large factor). I'm sure I could make it faster if I spent more time on it, but this was more than fast enough for me to consider it elegant.

Just remember that these problems start really hard and get even harder. Don't be disheartened if you can't figure them out immediately.

Thanks for the motivation and guide sir, I highly appreciate that.
(Oct 7, 2013 07:08 PM)jazzycool Wrote:  well sir I already python I have already written several programs with it now I was thinking of going into deep that is want to learn C and get into the Linux drivers programming and kernel programming so I was like demotivated because if I am not able to solve these problems how will I go manage the whole memory management or write kernel modules with C, so just wanted to know am I ok or will I have to leave programming.


Thanks for the motivation and guide sir, I highly appreciate that.

The questions are of a mathematical nature .Algorithm contests are like that.It can be solved but yeah it becomes hard very quickly.
yeah that is what I wasn't able to solve though it took me long time to figure out even after looking at the answers so.. but later I figured out that it may help you if you are really into it, but I am not really into I want to go more in depth for system programming, kernel development, programming Linux Drivers, software developing etc.
I would recommend going to codeacademy.com and doing the python tutorials (I did them and they helped me out so much) also if you want a good beginners bood for python check out this link

http://vmg.pp.ua/books/%D0%9A%D0%BE%D0%B...20Kids.pdf

The book is actually called Python for kids. I laughed at first but as i started reading it I realized it is so much easier to understand than other Pyhon books i've came across
Sir Can you please read the post first and then comment it would be much appreciated. I said I already know python I have made several programs with python, but was not able to solve those on euler.net so please first read and then post.
(Oct 12, 2013 09:14 AM)jazzycool Wrote:  yeah that is what I wasn't able to solve though it took me long time to figure out even after looking at the answers so.. but later I figured out that it may help you if you are really into it, but I am not really into I want to go more in depth for system programming, kernel development, programming Linux Drivers, software developing etc.

The thing is, the mathematical algorithmic work is what helps create programs that run fast, not shit that takes ages to run through basic commands... I mean project euler is far from the perfect website for practicing algorithms, but some problems, for example 67, require lots of optimizations to make it run faster...

And if you wanna get into kernel and driver development, you should really look into learning C and assembly; but python is still useful for first drafts of functions, optimizing them, and then translating them into a lower level.
I actually did read your post but i just misunderstood you. I'm not sure what Euler is either. I apologize if my post annoyed you. I just misunderstood.
at first even I had a tough time , keep trying .
I tried again after a few months and the first 3-4 seemed quite easy .
So remember to come back to the website after some more programming practice , also for better mathematical concepts building go to brilliant.org and do weekly problems.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by _UnderDogJul 30, 2018 06:13 PM 6 409 Jul 30, 2018 06:13 PM
Last Post: _UnderDog
[.NET] by sofien ouennJun 28, 2014 03:32 AM 11 1,138 Jun 28, 2014 03:32 AM
Last Post: sofien ouenn
[Python] by ImportUsernameOct 31, 2013 03:12 PM 11 617 Oct 31, 2013 03:12 PM
Last Post: Misingnoglic