Python MOOC – Week 2

I’m going to sum up the experiences of the past week and share what I managed to find out.

First off, I really like the way the MOOC is organised. Especially the way it encourages team work and p2p-learning process. First the instruction was to sign up for OpenStudy, which is very good in terms of mutual help and revision. But there’s a problem there. You can ask questions there alright, but you can ask only one question at a time. That is, after you asked your question, it appears on the questions wire and everyone can see it and answer it. But if you want to ask another question, you’ll have to mark the current one as ‘closed’ and only then you’ll have an option to ask a new one. ‘Closed’ means that it is removed from the wire shown by default (to the list of closed questions) and if you haven’t received the answer so far, there’s a chance you’ll never have it because nobody will notice the question.

2013-06-30 20_32_53-OpenStudy

Ah yes, also OpenStudy is often down, so you sometimes simply can’t use it.

But there are great options outside. First is that the MOOC organisers divided all MOOCsters into teams and provided them with mailing list addresses, so some questions cans be asked and answered in small groups and you have no limitations here.

Finally, there’s one more learning space I discovered only yesterday and haven’t tried yet, but it looks great. I mean Groups at Codecademy (you have to sign in to see the page). Although I’ve been using Codecademy for quite a while now, I didn’t know about their existence. Of course I immediately joined Python for Beginners group. I hope it’ll be a great experience.

Now a couple of words about this week’s homework. This week was rather challenging for me, because I was struggling to understand how loops work, especially the for loop. One of the tasks was to write a code that calculates exponentials using a for loop. Thanks to my team mates who helped me figure out what the task was about in the first place  – that is that the task should be executed without using the in-built exponentiation (**) option.

Now, I had dealt with for loops at Codecademy and found them rather easy. This is what I basically imagined:

for i in range(1, 10, 2):

    print i

So it does what you tell it to with all the items in a range.

But in this case a possible resulting code I got after many efforts (and quite a bit of guesswork, I admit) looks like this:

base = input("Enter base: ")

exp = input("Enter exponent: ")

x = base

for n in range(1, exp):

    x *= base

print x

So after I wrote it, I still had a question: how are for n in range(1, exp): and x *= base connected if there are no obvious operations in which n (the items from the range) are mentioned? The answer is obviously that they don’t have to be mentioned. That is, the for loop in this case is used to show the computer how many times the operation must be repeated.

This is what I realised after reading this awesome article about loops in Python. And I also realised that there’s a great way to see what programme does by adding print statements that reflect the process step by step. Like so:

base = input("Enter base: ")

exp = input("Enter exponent: ")

x = base

for n in range(1, exp):

    x *= base

    print x # This shows what's going on in the process

print x

So for instance if we have base 5 and exp 4, the output will be:

25

125

625

625

Also one of my team mates kindly recommended me to read Learning Python by Mark Lutz (I found out on the way that there’s a whole site about it).

Finally, I played with PyScripter IDE and explored some code sharing options, which I’m going to describe soon.

Oh, by the way, if some peers want to have a look at my whole homework (with the exception of optional tasks I’ll get back to them a bit later), it’s here: https://gist.github.com/ansakoy

Making my presentation – part two

(Part one is here)

After I had my draft structure done I had to distribute the content along a 10-minutes’ timeline, because I had only 10 minutes for my presentation. Actually, I had 10-12 minutes, but I decided to leave 2 minutes as a reserve in case something goes wrong.

Now the process of distributing all I wanted to say properly was a real challenge. In order to make it easier, I first drafted a timeline in my notebook.

timeline

Then I typed the text word by word and tried to read it with a stopwatch. Although I managed to fit it into the time frame (at the third attempt), I realized that I have to make it even shorter and, what is most important, to get rid of syntactically complicated constructions. So I ended up having a text divided into parts according to my presentation slides with 3 to 8 sentences for each slide.

Ah yes, regarding slides. Well, I decided not to use the colour scheme I was testing in the previous post, because it seemed to me boring. Instead I took this one by plamenj, which looks like this:

2013-06-23 01_41_53-COLOURlovers.com - Gamebookers

And here’s my presentation at Slideshare (actually longer than it used to be, because I split the animated slides made in PowerPoint into separate slides, as Slideshare doesn’t read animation).

It is originally in Russian of course, but I translated it.

Also, thanks to Jakes from my wonderful Team 10, because he sent me very helpful materials regarding designing presentation. And thanks to Irina (from the same team among all) for also sharing materials and generally being extremely encouraging.

By the way, I found out that PowerPoint and SlideShare are badly compatible. So I had to do some extra editing to make it look similar to its initial ppt version. Maybe next time I’ll try playing with Google and Libre Office equivalents, as well as Presi.com. But hopfully, not too soon, because I want to get back to the wonderful Python MOOC, which has already begun. The 1st week’s tasks don’t look too challenging, but there’s a bunch of some new information that I want to digest before I receive the next portion of tasks.

Building a network

Social media are great, because they are omnipresent, fast, easy to handle, good for getting in touch with people, monitoring news and accumulating multiple sources of information. But I genuinely love blogs, exactly because they are slower and more fundamental. And I’m sure they’ve got a huge p2p collaboration and networking potential (alongside with other tools of course – e.g. Wiki or Google Docs). That’s why I liked the Webcraft 101 idea to create such a p2p blogging community. It can be built from scratch of course and this process can be facilitated by searching for people through specialised places like P2PU or even Getstudyroom. But I thought it could also be a good thing for staying in touch and collaboration with already existing peers.

Now, this is exactly my case. For more than a month know, I’ve been learning and working in a team within a Data Expedition. And it happened so that this teamwork has been actually the best thing in the entire process. School of data is a wonderful project and Data Expeditions are really an awesome idea, but also a very challenging one in terms of implementation. I can’t say everything is perfectly organised – it’s a pilot version after all. But I was lucky to get into a team that actually made up for all the organisational shortcomings. And also for the first time gave me a sense of a p2p learning process.

Team10

The Data Expedition is going to be over soon. But it doesn’t mean that the teamwork is going to finish, especially as some team members expressed their willingness to stay in touch and continue our cooperation. So blogging might become an important part of such long-term collaboration process. I hope it will. Anyway, why not try. I’ve already followed one of our team members’ new-born blog, which I will promote as soon asI find out that tis blog’s author doesn’t mind.

Well, that said, I must admit that this week I haven’t learnt as much technical stuff as I’d want to. But instead I’ve learnt quite a bit of new things about building online cooperation communities.

And I’ve also been trying to code every day – that is to spend at least 15 minutes by solving tasks at Codecademy. They say it is kind of important in order to learn something. I do hope it helps! OK, we’ll see. Anyway, it’s fun.

Getting good ideas from peers: Handwritten Python

IMAG0417A really nightmarish thing is learning too many subjects at a time. In my case, it normally results in learning nothing and quitting everything. Which is why having made the first step in the Webcraft course (which is creating a blog and finding some very interesting people) I have to overcome the urge to continue with HTML and get back to my unfinished stuff with Python and data.

But as I expected, following the P2PU people is very helpful, because it’s a source of great ideas. For instance, as I guess from several blog posts, one of the upcoming tasks in the course is writing an HTML code by hand in order to better understand the syntax. Well, at my beginner’s level in Python syntax is one of the worst problems. Unless I learn it, it always becomes some guess work (often rather successful, because tasks are still very simple). Not long ago I realized that surprisingly enough the idea of learning new words and phrases by heart in order to remember them seems to me absolutely obvious and normal when it comes to human languages (I’m currently learning Greek for instance), but it feels really infuriating when it comes to machine languages. While there’s actually not so much difference, only the machine languages must be much easier in terms of vocabulary and syntax.

Now, I really liked the idea of writing a code by hand in order to remember the syntax and I decided to try it with Python. To that end, I used a short simple code from a Codecademy task that I’ve already successfully done. It’s about dictionaries and lists. Well, I tried to reproduce a similar syntactically correct code on paper. It took me 4 attempts to complete it without any mistakes (I hope)! But now I feel a bit more comfortable with it.

Thanks for sharing good ideas, peers.

UPD: Oops. Just noticed one mistake. It should have been “list1” or something like that… not just “list”…