[Tutor] What would you say is the best way to continue learning python

Magnus Lycka magnus@thinkware.se
Sun, 22 Sep 2002 01:45:02 +0200


At 22:42 2002-09-21 +0200, Gregor Lingl wrote:
>Danny schrieb:
>
>>I have now just about completed the book learn python in 24 hours although=
 I
>>have learned a lot I still feel very lost I have also read through the=
 tutor

Read through? Did you experiment with all the things the Tutorial
mentions? You won't learn how to program with your eyes. You can
only learn that with your fingers!

Try it out properly. Experiment. Test the limits of python and your
own knowledge. The python environment is excellent to experiment in.

>>and some of the doc's included in python and even downloaded them all in=
 PDF
>>format I still feel lost even considering that what else can I read or do=
 to
>>continue my learning process so I can be as good as most of you in very=
 good
>>time of course.  Thanks for you time and consideration in my learning
>>process Oh before I forget I have bought a lot of C++ books I want to=
 learn
>>that as well could those help me any in python.
>Of course! Look for some examples in those C++ books you like and recode=20
>them in Python.
>That would be learning by doing. Very rewarding.
>Gregor
>
>You also may have a look at:
>http://www.norvig.com/21-days.html

Regarding Norvigs notice that it might take 10 years to learn things,
I could mention the yearly programming tests referred to in DeMarco &
Lister's excellent book "Peopleware". In their measurements, people with
ten years of experience was not better than those with two years of
experience. People with less than half a year of experience was clearly
less productive though. So, perhaps it takes around a year of practice
to become proficient in a programming laguage?

Either way, I also suggest learning by doing. All people are different,
and I don't think there is one method that fits all, but I'd try to
make something practical, and then get back to this mailing list when
I get stuck. A few possible assignments follow:

1. Make a program that will start programs listed in a text file.
For example, a user could edit a text file so that it looked as
the lines between the dashes below, and invoking the program you
write, the programs would all be started. Hint: os.system()

----
excel.exe
winword.exe
c:\python22\python.exe
----

2. The factorial of a number n is 1 * 2 * 3 ... (n-1) * n. E.g.
the factorial of 5 is 1 * 2 * 3 * 4 * 5  =3D 120. Write a program
that will calculate the factorial of a given positive number.
Try a few different solutions.

3. The first fibonacci numbers are 0 and 1. The following fibonacci
numbers are the sum of the two preceding fibonacci numbers. I.e.
0, 1, 1, 2, 3, 5, 8, 13 ... Write a program that will calculate
the n:th fibonacci number. Try a few different solutions.

4. Write a program that will count the frequency of words in a
text file. (You can run it on an archive of this mailing list and
see what we talk about most! :)

5. Write a program that will print the current date and time
for a location if you enter the name of a major city. (Ignore
daylight savings time in the first version.) Hint: import time

6. Write a program that will ask for an activity when invoked,
and store that activity with a timestamp in a text file. Having
used the program for a while your text file might look like this:

----
2002-09-22 09:15:12 program
2002-09-22 11:17:23 read email
2002-09-22 13:01:51 lunch
2002-09-22 13:47:12 program
2002-09-22 17:42:00 stop
----

7. Write a program that reads the file in assignment 5 and
summarizes the amount of time for each activity.

8. Write a program that proves that when n is an integer,
n > 2, the equation x**n + y**n =3D z**n has no solution in
positive integers x,y,z. (x**n is the Python notation for
x to the power of n, i.e. 4**3 =3D 4*4*4.)


/Magnus

P.S. Assignment number 8 is not trivial.


--=20
Magnus Lyck=E5, Thinkware AB
=C4lvans v=E4g 99, SE-907 50 UME=C5
tel: 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se