43
votes

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.

0

8 Answers 8

47
votes

UPDATE (Jan 2020): There are many great online places to get beginner practice at Python, some which are highly engaging and/or otherwise interactive. These sites are generally more practical than the Python Challenge (http://pythonchallenge.com), which you can tackle later. (After years of experience, you can try the Python "wat" quiz). For now, it's most important to learn, practice, and have fun. Welcome to Python!

ps. BTW (by the way), your experience puts you right in the heart of the target audience of my Python book, Core Python Programming. That audience is those who know how to code in another high-level language but want to learn Python as quickly but as in-depth as possible. Reviews, philosophy, and other info at http://corepython.com

pps. The following resources were previously on the list but are no longer available.

Sign up to request clarification or add additional context in comments.

Comments

9
votes

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.

1 Comment

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.
6
votes

You could also try CheckIO which is kind of a quest where you have to post solutions in Python 2.7 or 3.3 to move up in the game. Fun and has quite a big community for questions and support.

From their Main Wiki Page:

Welcome to CheckIO – a service that has united all levels of Python developers – from beginners up to the real experts!  

Here you can learn Python coding, try yourself in solving various kinds of problems and share your ideas with others. Moreover, you can consider original solutions of other users, exchange opinions and find new friends.  

If you are just starting with Python – CheckIO is a great chance for you to learn the basics and get a rich practice in solving different tasks. If you’re an experienced coder, here you’ll find an exciting opportunity to perfect your skills and learn new alternative logics from others. On CheckIO you can not only resolve the existing tasks, but also provide your own ones and even get points for them. Enjoy the possibility of playing logical games, participating in exciting competitions and share your success with friends in CheckIO.org!

1 Comment

Hi, welcome to SO. When posting answers that involve references to other sites, please post link information too. I have edited your post for now (should be visible shortly). Have fun!
4
votes

I used http://codingbat.com/ . A great website that not only takes one answer, like Project Euler, but also checks your code for more robustness by running it through multiple tests. It asks for much broader code than Project Euler, but its also much simpler than most Euler problems. It also has progress graphs which are pretty cool.

Comments

3
votes

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.

4 Comments

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.
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.
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.
definitely NOT for beginners, also rather old now
2
votes

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!

1 Comment

Python wasn't publicly released until 1991 - did you mean 1998?
1
vote

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.

Comments

0
votes

Try this site full of Python Practice Problems. It leans towards problems that has already been solved so that you'll have reference solutions.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.