tags:

views:

255

answers:

5

Well just getting into the flow of thing with Python. Reading a few books, finding it fairly easy as I already have some experience with C++/Java from school and Python is definetly my favorite thus far.

Anyway, I am getting a whole bunch of information on python, but haven't been putting it to much use. Thus, what I was wondering was if there are any sort of practice problems online that I can use? If anyone could point me in any sort of direction, I'd greatly appreciate it.

+5  A: 

Try Project Euler:

Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems.

The problem is:

Add all the natural numbers below 1000 that are multiples of 3 or 5.

This question will probably introduce you to Python for-loops and the range() builtin function in the least. It might lead you to discover list comprehensions, or generator expressions and the sum() builtin function.

fmark
Yeah, the problems require application of algorithms to produce good solutions - they don't actually *teach* anything at all. To solve them, you need to already have a good idea of what you're doing, and the only way you can get feedback as to possible approaches to a problem is to actually solve it - not much good (learning-wise) if you're stuck on a particular problem.
Mac
+3  A: 

The Python Challenge will not only let you exercise the Python you do know, it will also require you to learn about various popular third-party packages in order to solve some of the challenges.

Ignacio Vazquez-Abrams
You may have missed the word »beginner« from the question. Also things like PC aren't for everyone. Those puzzles *are* very convoluted and don't teach you that much about programming or usage of a language.
Joey
No, I think it's just fine to be forced to stretch a bit, even as a beginner. You can only write a prime generator so many times before it starts being pointless.
Ignacio Vazquez-Abrams
Of course it's fine to be forced to stretch a bit, but that entails something like learning about a new language feature, writing a program to fulfill some practical requirements, or looking through some existing source code to see how it works. The Python Challenge doesn't count. All it does is "reward" you for correctly guessing the author's intentions, which is useless as a teaching technique.
David Zaslavsky
+1  A: 

I found python in 1988 and fell in love with it. Our group at work had been dissolved and we were looking for other jobs on site, so I had a couple of months to play around doing whatever I wanted to. I spent the time profitably learning and using python. I suggest you spend time thinking up and writing utilities and various useful tools. I've got 200-300 in my python tools library now (can't even remember them all). I learned python from Guido's tutorial, which is a good place to start (a C programmer will feel right at home).

python is also a great tool for making models -- physical, math, stochastic, etc. Use numpy and scipy. It also wouldn't hurt to learn some GUI stuff -- I picked up wxPython and learned it, as I had some experience using wxWidgets in C++. wxPython has some impressive demo stuff!

Python wasn't publicly released until 1991 - did you mean 1998?
fmark
+1  A: 

I always find it easier to learn a language in a specific problem domain. You might try looking at Django and doing the tutorial. This will give you a very light-weight intro to both Python and to a web framework (a very well-documented one) that is 100% Python.

Then do something in your field(s) of expertise -- graph generation, or whatever -- and tie that into a working framework to see if you got it right. My universe tends to be computational linguistics and there are a number of Python-based toolkits to help get you started. E.g. Natural Language Toolkit.

Just a thought.

Peter Rowell
+1  A: 

You'll find great beginner practice at http://singpath.appspot.com ... the "game" is interactive, gives you the ability to edit your answers, and the exercises are much more practical than the Python Challenge, plus there are multiple levels to choose from based on your skill level. If you're gonna compete, here are the current worldwide standings/rankings: http://singpath.appspot.com/ranking/10030

Most importantly, have fun, and welcome to Python!

ps. your experience puts you right in the heart of the target audience of my Python book, Core Python Programming , whose goal is to teach Python as quickly but as in-depth as possible. reviews, philosophy, and other info at http://corepython.com

wescpy
+1 for singpath. Excellent beginner's practice.
John McCollum