Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Python Exercises
Index -> Programming, Python -> Python Tutorials
Goto page 1, 2, 3  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
McKenzie




PostPosted: 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.


Exercises.zip
 Description:

Download
 Filename:  Exercises.zip
 Filesize:  470.78 KB
 Downloaded:  6641 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Nick




PostPosted: 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




PostPosted: 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




PostPosted: Tue Feb 19, 2008 4:04 pm   Post subject: Re: Python Exercises

My school only teaches turing? I wonder why...
Mackie




PostPosted: Tue Feb 19, 2008 5:08 pm   Post subject: RE:Python Exercises

Awesome stuff. +30 bits
McKenzie




PostPosted: 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




PostPosted: 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




PostPosted: 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
Sponsor
sponsor
wtd




PostPosted: 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




PostPosted: 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




PostPosted: Tue Feb 26, 2008 7:34 pm   Post subject: RE:Python Exercises

Oh, I never claimed they were perfect.
wtd




PostPosted: Wed Feb 27, 2008 1:30 am   Post subject: RE:Python Exercises

Constructive criticism. Smile

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.
swami




PostPosted: Tue Apr 01, 2008 9:54 pm   Post subject: Re: Python Exercises

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.
wtd




PostPosted: Tue Apr 01, 2008 10:02 pm   Post subject: RE:Python Exercises

If he fully understood Java then he'd be quite a marvel, wouldn't he? Wink
A.J




PostPosted: Tue Apr 01, 2008 10:05 pm   Post subject: Re: Python Exercises

Thanks Mckenzie!
I didn't intend to learn Python, but now if I want to, I can Very Happy!
Display posts from previous:   
   Index -> Programming, Python -> Python Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 3  [ 42 Posts ]
Goto page 1, 2, 3  Next
Jump to:   


Style:  
Search: