[Tutor] Beat me over the head with it

Paul Schewietzek tetsuo2k6 at web.de
Tue Dec 11 13:11:34 CET 2007


Theyain schrieb:
> I'm not sure if this is really the place to do this, but I will ask anyways.
> 
> Hello everyone, names Theyain.  I want to learn Python.  But I am one of 
> those people who needs some one to "Beat me over the head" to actually 
> learn something.  I can't get myself to actually sit down and read a 
> tutorial on Python because no one is making me.  So can someone help me 
> with this?  I really want to learn python, but I can't do it with out help.
> 
> 
> So help?
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 

Reminds me of the all-queen problem... :)

If you know chess, you could try the following:

Step 1: Arrange 8 queens on a chessboard in a way that no queen is 
threatened by any other.

Step 2: Write a script that prints out all possible solutions to this 
problem. Can be printed in text-mode so you don't have to worry about 
real graphics when starting, like this:

	 ---------------
	| | | | | | | | |
	 ---------------
	| | | | | | | | |
	 ---------------
	| | | |X| | | | |
	 ---------------
	| | | | | | | | |
	 ---------------
	| |X| | | | | | |
	 ---------------
	| | | | | | | | |
	 ---------------
	| | | | | |X| | |
	 ---------------
	| | | | | | | | |
	 ---------------

	where X is a queen - of course there shall be eight (8) X'es :)

Step 3: Make the board scalable (6 queens on a 6x6 board, 12 queens on a 
12x12 board, n queens on a n x n board) - Hint: 4 is the minimum, 
smaller setups have no solution.

This exercise isn't really meant to learn a specific language, but 
rather to learn how to solve a problem algorythmically - However it WILL 
give you a feeling for Python, tracing back the bugs you will encounter :)

If you feel it is to hard, write back and I'll give you hints how to 
structure the script (logically - I definitively have no time for syntax 
questions. And by the way, I am relatively new to Python myself :))

Good Luck!


More information about the Tutor mailing list