Posted: Sat Jan 12, 2008 2:20 pm Post subject: Python Exercises
I assume that if you are looking in the Python Tutorial section you are interested in learning Python. There are a number of great Python tutorials out there, the problem is simply reading them and trying a few little scripts is not enough to really learn Python. The best way to learn something is by doing it. Here are a collection of exercises that I give to my grade 11 students. Keep in mind that most of my students start with no background whatsoever, so if you already know how to program then the early exercises will be very simple. I would suggest doing them anyways. The more problems you do the better ingrained the syntax of the language will become. In my class work comes in the form of exercises, assignments and projects. Exercises are problems that we simply take up in class, but are not marked. If you really want more work I can make my assignments and projects available, but the exercises should be good enough to teach the language fundamentals.
Posted: Sat Jan 12, 2008 3:18 pm Post subject: RE:Python Exercises
I learn best through exercises so for this I thank you +10 bits
SIXAXIS
Posted: Tue Feb 19, 2008 3:52 pm Post subject: Re: Python Exercises
Thanks.
P.S. You teach Python in grade 11? Our school teaches Java instead.
BigBear
Posted: Tue Feb 19, 2008 4:04 pm Post subject: Re: Python Exercises
My school only teaches turing? I wonder why...
Mackie
Posted: Tue Feb 19, 2008 5:08 pm Post subject: RE:Python Exercises
Awesome stuff. +30 bits
McKenzie
Posted: Tue Feb 19, 2008 8:17 pm Post subject: Re: Python Exercises
Why Turing/Java/Python in grade 11?
The choice of language for grade 11 is something I assume most schools take fairly seriously. I've been teaching 13 years and every year I review my choice of languages and ask myself if they are the best choices. I assume I'm not alone in this. Every language has Pros and Cons.
Despite what you might think or hear around here I believe Turing is still a solid language in grade 11. It's a small language, so it is easy to learn almost all of the commands in one year and focus on imperative problem solving. It's a fun language to program in that makes graphics very easy to use. Turing does have a number of problems. It not being used outside of the Ontario Education system is probably the biggest. The next biggest is that the object-oriented syntax feels like it was awkwardly tacked on.
I think most schools that teach Java in grade 11 do so because they want to use the same language for gr 11 and 12 so they can get past talking about syntax and focus on key concepts. I can't imagine many teachers feeling that Java is a great starter language, but in the big picture I understand their choice. Why Java in grade 12? Lots of reasons. AP CS is in Java, universities use Java quite a bit (yes I know about Waterloo and Scheme)
I don't know of any other schools teaching Python in grade 11, but I wouldn't be shocked to find one. I chose Python for a number of reasons. It is a language that is actually being used. It has syntax that is about as easy to pick up as Turing. I'm hoping the object-oriented nature of it will allow a better transition to Java in grade 12. I'm someone who likes to have different languages each year to force students to be more adaptable and to realize that most computer concepts/algorithms transcend the language they use. I debated long and hard between Python and Ruby, but decided on Python based on the strength of pygame, and the relative maturity of the community. Most students like to do a game for their final project so pygame was very important to me.
Please don't annoy/harass your teachers about their choice of programming languages, but a long as you approach them from a point of view of genuinely wanting to know why they teach language X, and have they considered language Y most teachers will be very honest with you.
wtd
Posted: Wed Feb 20, 2008 1:35 am Post subject: Re: Python Exercises
McKenzie @ Wed Feb 20, 2008 9:17 am wrote:
Why Turing/Java/Python in grade 11?
The choice of language for grade 11 is something I assume most schools take fairly seriously. I've been teaching 13 years and every year I review my choice of languages and ask myself if they are the best choices. I assume I'm not alone in this.
I'm not sure that's a safe assumption. You seem an uncommonly conscientious teacher. The fact that you come here and interact with students in your free time demonstrates that quite well.
McKenzie
Posted: Wed Feb 20, 2008 7:24 am Post subject: Re: Python Exercises
It's not an accurate assumption, but it is a safe one. If kids assume that their school is teaching language X because it's all they know, or those are the books they have then if they talk to their teacher will be more likely to come off with an arrogant attitude. If they start with the assumption that the language choices were made for good reasons then ask what they are then they will come off with respect. No matter how good or bad your teacher is, respect goes a long way. Assume the best of people, if they prove you wrong, so be it.
In they old system I used to teach
gr 11 - Turing
gr 12 - C
OAC - C++
Every year I would have one or two arrogant kids in gr 11 ask why can't we learn a real language like C, and at the same time I would have good grade 12 kids fighting to learn basic C syntax and missing the "good-ol-days" of Turing. Even this year, teaching Python, I've had a kid look down their nose at Python and say we should be learning C++ instead. Not that he knew anything about C++ to make that call, just the basic assumption that no matter what we are doing it's not good enough for him.
Sponsor Sponsor
wtd
Posted: Wed Feb 20, 2008 10:36 am Post subject: RE:Python Exercises
It was meant more as a compliment than as a way of denigrating your peers. Still, I can understand where you're coming from.
wtd
Posted: Tue Feb 26, 2008 4:25 pm Post subject: RE:Python Exercises
From unit 2.5:
code:
i = 0
while i < 10:
n = i ** 2
if i % 2 == 0:
print n
I could be mistaken, but is this not an infinite loop, as nothing updates i?
McKenzie
Posted: Tue Feb 26, 2008 7:34 pm Post subject: RE:Python Exercises
Oh, I never claimed they were perfect.
wtd
Posted: Wed Feb 27, 2008 1:30 am Post subject: RE:Python Exercises
Constructive criticism.
I'm a big fan of release early and realease often and constantly revising. But that only works if people are annoying and point out bugs.
Yea, at my school we learned the basics of Turing in grade 10 and went more in depth in grade 11. Now in grade 12 we are learning Python. Last year in grade 12 students learned Java. My teacher is deciding to teach something new and introduce a language that he himself dose not fully know yet.