tags:

views:

189

answers:

5

Where can i find good practice python problems with solutions?

I'm looking for detailed practice problems that are designed with a coding purpose in mind.

A: 

Try the Google Code Jam. They have solutions from participants for past contests, some of which are in Python. Take into account that as in any programming competition, the goal there isn't to learn Python - it's to get the job done as quickly as possible. So you may not learn the cleanest programming style, but you will see how smart people use the language to solve complex problems in an efficient manner.

Eli Bendersky
+5  A: 

Python Challenge is a great place for beginners to learn Python in an interesting way.

EDIT - To answer the comments below, yes, there are solutions (and hints too) often in multiple languages meaning you can really use whatever language you like (though primary support is obviously in Python)

Chris Knight
are there solutions, though?
Eli Bendersky
I don't know, a lot of those challenges tend to be guesswork/hunting as opposed to thinking out a solution to a problem and coding it.
Wallacoloo
that is so cool thanks!
Dmitry Shevchenko
This looks pretty good, there are solutions on a wiki it seems. Thx!
+5  A: 

A good set of problems can be found at Project Euler (though not specifically for Python). You get to the solution only after you've actually solved the problem. But even then, you can usually learn a lot from the other solution(s) - see how it can be done in other languages, and (more importantly) how it can be done even more elegantly.

Tim Pietzcker
+1 this is how I learned Python
BlueRaja - Danny Pflughoeft
Project Euler is more about mathematics than about programming/coding
Srinivas Reddy Thatiparthy
Yes, but most of the mathematical problems have an algorithmic solution, so you need a computer to solve it in reasonable time. And programming is about algorithms. At least partly.
Tim Pietzcker
euler is cool, definitely more along the lines of algos thx., useful also to see other languages
+1  A: 

It all depends on what you understand under "problem", "coding" and "practice". For example, my first guess is you might be interested in looking up whatever university courses on algorithms using Python that you can google out. Here's one arbitrary link.

It's also worth looking at classic textbooks, those have lots of examples.

Finally, try looking at the tutorials from certain specialized packages, such as Scipy, Turbogears, PyGame, etc.

If that's not enough, you can just go read the source code of some existing open source software. That might also help.

KT
Yeah, it is not for a class amazingly lol. I'm an engineer so it's more like trying to learn the language practically beyond the shell stuff I do (I've installed scipy and can use scipy and matlab).
In this case you should also take a look at Sage (http://sagemath.org)
KT
Thanks for the sagemath link -- how does it emulate matlab's vectors and signal processing?
It has numpy/scipy built in, which provides very similar functionality.
KT
+1  A: 

CodingBat (previously JavaBat) now has Python thanks to Google. Some problems have hints and solutions. Your answer can be tested automatically for correctness.

polygenelubricants
nice thanks, it's also nice to have JAVA