473,326 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Programming exercises/challenges

Hi guys,

I'm learning Python by teaching myself, and after going through several
tutorials I feel like I've learned the basics. Since I'm not taking a
class or anything, I've been doing challenges/programs to reinforce the
material and improve my skills. I started out with stuff like "Guess my
number" games, hangman, etc. and moved on to making poker and card
games to work with classes. For GUIs I created games like minesweeper,
and a GUI stock portfolio tracker. I am out of ideas and am looking for
programming projects, challenges, or programs that have helped you'll
learn. I'm working on the project Euler problems, but I find that they
don't really help my programming skills; they are more math focused.
Suggestions? What has been useful or interesting to you? I'd also
welcome sources of textbook type problems, because the ones provided in
tutorials tend to be repetitive.

Thanks,
Ben
Nov 19 '08 #1
13 3089
On Nov 18, 6:39�pm, btk...@email.unc.edu wrote:
Hi guys,

I'm learning Python by teaching myself, and after going through several
tutorials I feel like I've learned the basics. Since I'm not taking a
class or anything, I've been doing challenges/programs to reinforce the
material and improve my skills. I started out with stuff like "Guess my
number" games, hangman, etc. and moved on to making poker and card
games to work with classes. For GUIs I created games like minesweeper,
and a GUI stock portfolio tracker. I am out of ideas and am looking for
programming projects, challenges, or programs that have helped you'll
learn. I'm working on the project Euler problems, but I find that they
don't really help my programming skills; they are more math focused.
Suggestions? What has been useful or interesting to you?
Math problems. :-)
I'd also
welcome sources of textbook type problems, because the ones provided in
tutorials tend to be repetitive.
I read rec.puzzles regularly and always approach each puzzle
in a "how would I solve this with a program" way. Not all
lend themselves to computer solutions, some of the regulars
there frown on computer answers and some are simply math
problems in disguise. I follow sci.math for the same reason.

And alt.math. And alt.math.recreational.

Another hobby I have is tracking movie box-office receipts
(where you can make interesting graphs comparing Titanic
to Harry Potter or how well the various sequels do, if Pierce
Brosnan saved the James Bond franchise, what can you say about
Daniel Craig?). Lots of potential database problems there.
Not to mention automating the data collection from the Internet
Movie Database by writing a web page scraper than can grab
six months worth of data in a single session (you probably
wouldn't need this if you cough up a subscription fee for
professional access, but I'm not THAT serious about it).

There is nothing like such a hobby to provide motivation to
learn programming.

Here's something interesting: take a films opening weekend
box-office receipts and multiply it by Pi. You'll get the
film's total gross.
>
Thanks,
Ben
Nov 19 '08 #2
On Wed, Nov 19, 2008 at 2:39 AM, Mensanator <me********@aol.comwrote:
Another hobby I have is tracking movie box-office receipts
(where you can make interesting graphs comparing Titanic
to Harry Potter or how well the various sequels do, if Pierce
Brosnan saved the James Bond franchise, what can you say about
Daniel Craig?). Lots of potential database problems there.
Not to mention automating the data collection from the Internet
Movie Database by writing a web page scraper than can grab
six months worth of data in a single session (you probably
wouldn't need this if you cough up a subscription fee for
professional access, but I'm not THAT serious about it).
This is really interesting. What would one need to do such a thing?
The only program web related I did in Python was generating a rss feed
from a local newspaper static site, using BeautifulSoup. But I never
put it on an online host. I'm not even sure if I could run. What
requisites should have the host to run python code?

Thanks and sorry for the meddling.
Nov 19 '08 #3
On Wed, Nov 19, 2008 at 1:35 PM, Jeremiah Dodds
<je************@gmail.comwrote:
>
Personally, I prefer a host that gives me root on a box (or virtual
machine). I've had a great time with slicehost (http://slicehost.com).
Yes, I knew about slicehost, but it is expensive for what I need to
do, that is just experimentin a bit.
There are a few hosts that specialize in, or explicitly offer python
hosting, http://wiki.python.org/moin/PythonHosting has an overview of them.
Thanks for the link, seems useful.
Nov 19 '08 #4
On Nov 18, 6:39*pm, btk...@email.unc.edu wrote:
Hi guys,

I'm learning Python by teaching myself, and after going through several
tutorials I feel like I've learned the basics. Since I'm not taking a
class or anything, I've been doing challenges/programs to reinforce the
material and improve my skills. I started out with stuff like "Guess my
number" games, hangman, etc. and moved on to making poker and card
games to work with classes. For GUIs I created games like minesweeper,
and a GUI stock portfolio tracker. I am out of ideas and am looking for
programming projects, challenges, or programs that have helped you'll
learn. I'm working on the project Euler problems, but I find that they
don't really help my programming skills; they are more math focused.
Suggestions? What has been useful or interesting to you? I'd also
welcome sources of textbook type problems, because the ones provided in
tutorials tend to be repetitive.

Thanks,
Ben
You night look at "Useless Python" (you'll have to Google for the
site). It has tons of problems from trivial to complex.
--greg
Nov 19 '08 #5
On Wed, Nov 19, 2008 at 1:50 PM, Jeremiah Dodds
<je************@gmail.comwrote:
If you need to do it on the extremely cheap, you can host on your own
machine on a port other than 80, make sure your router / firewall is
forwarding the port to your machine, and use dyndns (http://dyndns.com) to
give yourself a domain name. CherryPy (http://cherrypy.org) makes the python
side of hosting a simple service or app quite painless. I use this method to
host a little app for downloading Ubuntu packages and their dependencies as
a tarfile on my personal machine.
Thanks, I'll try.

To turn back in topic, there is the python challenge:
http://www.pythonchallenge.com/
I started it when I was learning Python, but since the beginning it is
not as simple as they say on the site. It maybe stimulating.
Nov 19 '08 #6

On Nov 19, 2008, at 7:12 AM, Mr.SpOOn wrote:
On Wed, Nov 19, 2008 at 2:39 AM, Mensanator <me********@aol.com>
wrote:
>Another hobby I have is tracking movie box-office receipts
(where you can make interesting graphs comparing Titanic
to Harry Potter or how well the various sequels do, if Pierce
Brosnan saved the James Bond franchise, what can you say about
Daniel Craig?). Lots of potential database problems there.
Not to mention automating the data collection from the Internet
Movie Database by writing a web page scraper than can grab
six months worth of data in a single session (you probably
wouldn't need this if you cough up a subscription fee for
professional access, but I'm not THAT serious about it).

This is really interesting. What would one need to do such a thing?
The only program web related I did in Python was generating a rss feed
from a local newspaper static site, using BeautifulSoup. But I never
put it on an online host. I'm not even sure if I could run. What
requisites should have the host to run python code?
I'm not sure why you'd need to host the Python code anywhere other
than your home computer. If you wanted to pull thousands of pages from
a site like that, you'd need to respect their robots.txt file. Don't
forget to look for a crawl-delay specification. Even if they don't
specify one, you shouldn't let your bot hammer their servers at full
speed -- give it a delay, let it run in the background, it might take
you three days versus an hour to collect the data you need but that's
not too big of deal in the service of good manners, is it?

You might also want to change the user-agent string that you send out.
Some sites serve up different content to bots than to browsers.

You could even use wget to scrape the site instead of rolling your own
bot if you're more interested in the data manipulation aspect of the
project than the bot writing.

Enjoy
Philip

Nov 19 '08 #7
On Wed, Nov 19, 2008 at 3:41 PM, Philip Semanchuk <ph****@semanchuk.comwrote:
I'm not sure why you'd need to host the Python code anywhere other than your
home computer. If you wanted to pull thousands of pages from a site like
that, you'd need to respect their robots.txt file. Don't forget to look for
a crawl-delay specification. Even if they don't specify one, you shouldn't
let your bot hammer their servers at full speed -- give it a delay, let it
run in the background, it might take you three days versus an hour to
collect the data you need but that's not too big of deal in the service of
good manners, is it?
Mmm, I didn't really mean the possibility to just host the code, but
to run. I mean, like server side code, so that my programs keep
running and updating, in my case, the RSS feed, without the need for
me to be online and run it.
Nov 19 '08 #8
Edwin <ex****@gmail.comwrites:

[...]
a diary manager compatible with my Emacs diary file (sometimes I don't
want to open Emacs for a quick note)
You mean that you sometimes don't have emacs open?

--
Arnaud
Nov 20 '08 #9
On Nov 20, 12:39*am, Arnaud Delobelle <arno...@googlemail.comwrote:
Edwin <exp...@gmail.comwrites:

[...]
a diary manager compatible with my Emacs diary file (sometimes I don't
want to open Emacs for a quick note)

You mean that you sometimes don't have emacs open?

--
Arnaud
heh... I believe in the potpourri style mate (and I don't mean petals
and spices).
After all I'm no expert.
Nov 20 '08 #10
>a diary manager compatible with my Emacs diary file (sometimes I
don't want to open Emacs for a quick note)
ArnaudYou mean that you sometimes don't have emacs open?

I am constantly amazed at work that people open a separate emacs for each
file they want to edit. Most of them seem not to even know that find-file
exists.

Skip

Nov 20 '08 #11
On Nov 20, 6:28*am, s...@pobox.com wrote:
* * >a diary manager compatible with my Emacs diary file (sometimesI
* * >don't want to open Emacs for a quick note)

* * ArnaudYou mean that you sometimes don't have emacs open?

I am constantly amazed at work that people open a separate emacs for each
file they want to edit. *Most of them seem not to even know that find-file
exists.

Skip
Come on mate... it's already a bit hard to post in a non-native
language. As a beginner in Python it's just "my two pennies worth",
really.

Cheers,
E.
Nov 21 '08 #12
>I am constantly amazed at work that people open a separate emacsfor
each file they want to edit. *Most of them seem not to even know that
find-file exists.
EdwinCome on mate... it's already a bit hard to post in a non-native
Edwinlanguage. As a beginner in Python it's just "my two pennies
Edwinworth", really.

No knock on you at all, just an observation about the work patterns many of
my colleagues have. The people I work with are professional software
engineers, engineers, quantitative analysts, etc. Many not at all new to
Python, C++, Unix or Emacs. And it's not like I haven't shown them howto
do it. I showed one guy how to exchange two adjacent words today with M-t.
He about fell off his chair.

Come to think of it, the one other person I work with who always keeps an
Emacs open is a vi user who likes it for sql mode. Nothing else. He runs
viper mode and keeps an sql mode buffer open continuously with all his
little sql snippets ready to submit to our Sybase server. When he usesvim
to edit? One vim session per file. I'm pretty sure that vim allows you to
open multiple files at once as well. Go figure.

Skip
Nov 21 '08 #13
On Nov 20, 10:32*pm, s...@pobox.com wrote:
* * >I am constantly amazed at work that people open a separate emacs for
* * >each file they want to edit. *Most of them seem not to even know that
* * >find-file exists.

* * EdwinCome on mate... it's already a bit hard to post in a non-native
* * Edwinlanguage. As a beginner in Python it's just "my two pennies
* * Edwinworth", really.

No knock on you at all, just an observation about the work patterns many of
my colleagues have. *The people I work with are professional software
engineers, engineers, quantitative analysts, etc. *Many not at all new to
Python, C++, Unix or Emacs. *And it's not like I haven't shown them howto
do it. *I showed one guy how to exchange two adjacent words today with M-t.
He about fell off his chair.

Come to think of it, the one other person I work with who always keeps an
Emacs open is a vi user who likes it for sql mode. *Nothing else. *Heruns
viper mode and keeps an sql mode buffer open continuously with all his
little sql snippets ready to submit to our Sybase server. *When he usesvim
to edit? *One vim session per file. *I'm pretty sure that vim allows you to
open multiple files at once as well. *Go figure.

Skip
No worries. I actually agree. I've found myself in situations like the
ones you describe, finding new commands and realizing there's more to
it than I thought. I have to point out that I myself use Vim more than
Emacs. Not because I think it's better (I'm not a religious person)
but because it has better integration with my Mac... and actually, I
use them for different programming tasks.

As a newcomer to Unix (I've come from Web related fields) I've been
learning not only how to use the operating system, but also Python,
Emacs, Vim, bash, etc. This hasn't been easy, of course, but it has
been quite interesting and as I'm learning a specific topic (say
learning readline commands, how to access command history, etc.) I
don't always keep my editor open; sometimes I want to learn how an
editor does its stuff and then I 'hack' a script for manipulating a
relevant text file (like my diary).

I know you can run your favorite shell inside Emacs and learn from
there, but being the only computer at home (and not the fastest) I
don't want to be opening programs all the time (maybe my girlfriend
has several programs running) so being able to write some beginners'
scripts to solve common tasks has been a good learning experience for
me.

Greetings from the third world (or is it underdeveloped? ;))
E.
Nov 21 '08 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark | last post by:
Hello. I am new to programming and Python and was wondering if someone could help get me started. I picked Python to start learning to prgram because of some things I have read about it (easy to...
8
by: Wous Mant | last post by:
Hello, I am a student in an university and studying C++.Final exams are coming.I'd like to solve as much exercises as possible.I'd like you to test myself with different kind of exercises.Do you...
5
by: Mr. X | last post by:
Hello, Let me begin by saying that I am a strong advocate of science, math and engineering students learning to program... just a skill that they need to experience even if they go another path....
42
by: Kevin Spencer | last post by:
Is it just me, or am I really observing a trend away from analysis and probem-solving amongst programmers? Let me be more specific: It seems that every day, in greater numbers, people are coming...
18
by: Frankie | last post by:
I have been hired to go to a former client of mine and train their staff programmers on ASP.NET. These guys have only Mainframe, MS Access, SQL Server, and VB6 desktop application development...
9
by: Ajinkya | last post by:
Me along with some of my friends have formed a programming group on google to discuss programming problem approaches.... Do join it will be helpful to all beginners and experts same. Here is...
5
by: Martin | last post by:
I am trying to improve my Python skills through some exercises. Currently I am working on Larry's "15 exercises to know a programming language " (http://www.knowing.net/...
0
by: Stef Mientki | last post by:
hi Ben, btkuhn@email.unc.edu wrote: I'm working on an open source alternative for MatLab / LabView (math again ;-) and there's still a lot to do - (re-)design of the core engine (multi...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.