Skip to content

Commit 56ef270

Browse files
committed
Native speaker attacks.
In particular, functions are not methods - methods are just those functions attached to a class. This terminology should be updated throughout. I've resisted the temptation to correct American spellings ;) Just the first four pages done for now.
1 parent 1b71619 commit 56ef270

File tree

4 files changed

+39
-38
lines changed

4 files changed

+39
-38
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ We hope that we'll be able to make you love technology as much as we do!
1414

1515
When you'll finish the tutorial, you will have a simple, working web application: your own blog. We will show you how to put it online, so others will see your work!
1616

17-
It will (more or less) look like that:
17+
It will (more or less) look like this:
1818

1919
![Figure 0.1](images/application.png)
2020

21-
Ok, let's begin with the very basic thing...
21+
Ok, let's start at the beginning...

django/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ You see, when you're building a website, you always need a similiar set of compo
66

77
Luckily for you other people long ago noticed that web developers face similar problems when building a new site, so they teamed up and created frameworks (Django is one of them) that give you ready components you can use.
88

9-
Frameworks exist to save you from having to re-invent the wheel and help alleviate some of the overhead when you’re building a new site.
9+
Frameworks exist to save you from having to reinvent the wheel and help alleviate some of the overhead when you’re building a new site.
1010

1111
## Why do you need a framework?
1212

13-
To understand what Django actually is for, we need a closer look at the servers. First thing is that the server needs to know that you want it to serve you a webpage.
13+
To understand what Django actually is for, we need a closer look at the servers. The first thing is that the server needs to know that you want it to serve you a webpage.
1414

15-
Imagine a mailbox (port) which is monitored for incoming letters (requests). It is done by a web server. The web server also sends a response with a webpage. But when you want to send something, you need to have some content. And Django is something that helps you create the content.
15+
Imagine a mailbox (port) which is monitored for incoming letters (requests). This is done by a web server. The web server reads the letter, and sends a response with a webpage. But when you want to send something, you need to have some content. And Django is something that helps you create the content.
1616

1717
## What happen when someone requests a website from your server?
1818

19-
When a request comes to a web server it's passed to Django which tries to figure out what actually is requested. It takes a webpage address first and tries to figure out what to do. This part is done by Django's urlresolver (Note that a website address is called URL - Uniform Resource Locator, so the name *urlresolver* makes sense). It is not very smart - it takes a list of patterns and tries to match the URL. Django checks patterns from top to the bottom and if something is matched then Django passes the request to the associated function (which is called *view*).
19+
When a request comes to a web server it's passed to Django which tries to figure out what actually is requested. It takes a webpage address first and tries to figure out what to do. This part is done by Django's __urlresolver__ (Note that a website address is called a URL - Uniform Resource Locator, so the name *urlresolver* makes sense). It is not very smart - it takes a list of patterns and tries to match the URL. Django checks patterns from top to the bottom and if something is matched then Django passes the request to the associated function (which is called *view*).
2020

2121
Imagine a postman with a letter. She is walking down the street and checks each house number with the one on the letter. If it matches, they put the letter there. This is how the urlresolver works!
2222

2323
In the *view* function all interesting things are done: we can look at a database to look for some information. Maybe the user asked to change something in the data? Like a letter saying "Please change description of my job." - the *view* can check if you are allowed to do that, then update the job description for you and send back a message: "Done!". Then the *view* generates a response and Django can send it to the user's web browser.
2424

25-
Of course, the description above is a little bit simplified, but you don't need to know all the technical things yet. Knowing a general idea is enough.
25+
Of course, the description above is a little bit simplified, but you don't need to know all the technical things yet. Having a general idea is enough.
2626

2727
So instead of diving too much into details, we will simply start creating something with Django and we will learn all the important parts along the way!
2828

how_internet_works/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# How the Internet works?
1+
# How the Internet works
22

33
*This chapter is inspired by a talk "How the Internet works" by Jessica McKellar (http://web.mit.edu/jesstess/www/).*
44

@@ -15,11 +15,11 @@ a screen, mouse or a keyboard, because their main purpose is to store data and s
1515

1616
Ok, but you want to know how the Internet looks like, right?
1717

18-
We made a picture for you! It looks like this:
18+
We drew you a picture! It looks like this:
1919

2020
![Figure 1.1](images/internet_1.png)
2121

22-
Looks like a mess, right? But in fact it is a network of connected machines (*servers*). Hundreds of thousands of machines! Many, many kilometers of cables around the world! You can visit a Submarine Cable Map website (http://submarinecablemap.com/) to see how complicated the net is. Here is a screenshot from the website:
22+
Looks like a mess, right? In fact it is a network of connected machines (*servers*). Hundreds of thousands of machines! Many, many kilometers of cables around the world! You can visit a Submarine Cable Map website (http://submarinecablemap.com/) to see how complicated the net is. Here is a screenshot from the website:
2323

2424
![Figure 1.2](images/internet_3.png)
2525

@@ -41,7 +41,7 @@ Instead of address with street name, city, zipcode and country, we use IP addres
4141

4242
When you send a letter it needs to have certain features to be delivered correctly: address, postmark etc.. You also use language that the receiver understands, right? The same is with *data packets* you send in order to see a website: you use a protocol called HTTP (HyperText TransferProtocol).
4343

44-
So basically, when you have a website you need to have a *server* (machine) on which it is. The *server* is waiting for any incoming *requests* (letters that ask you to send your website) and it sends back your website (in another letter).
44+
So basically, when you have a website you need to have a *server* (machine) where it lives. The *server* is waiting for any incoming *requests* (letters that ask you to send your website) and it sends back your website (in another letter).
4545

4646
Since it is a Django tutorial, you will ask what Django does? When you send a response you don't always want to send the same thing to everybody. It is so much better if your letters are personalized especially for the person that has just written to you, right? Django helps you with creating these personalized, interesting letters :).
4747

python_introduction/README.md

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ After running the python command, the prompt changed to `>>>`. For us it means t
1919

2020
## Your first Python command!
2121

22-
Let's start with something really simple. For example, try typing some math, like `2+3` and hit Enter.
22+
Let's start with something really simple. For example, try typing some math, like `2 + 3` and hit Enter.
2323

2424
>>> 2 + 3
2525
5
@@ -57,24 +57,24 @@ Nice, huh? To see your name in uppercase, simply type:
5757
>>> "Ola".upper()
5858
'OLA'
5959

60-
You just used the `upper` __method__ on your string! A method (`upper`) is a set of instructions that Python has to perform on a given object (`"Ola"`) once you call it.
60+
You just used the `upper` __function__ on your string! A function (`upper`) is a set of instructions that Python has to perform on a given object (`"Ola"`) once you call it.
6161

62-
If you want to get the number of letters in your name, there is a method for that too!
62+
If you want to get the number of letters in your name, there is a function for that too!
6363

6464
>>> len("Ola")
6565
3
6666

67-
Wonder why sometimes you call methods by adding `.` at the end of the string (like `"Ola".upper()`) and sometimes you first call a method and place the string in parentheses? Well, in some cases, methods belong to objects, like `upper` that can only be performed on Strings. But sometimes, methods don't belong to anything specific and can be used on different types of objects, just like `len`. That's why we're giving `"Ola"` as a parameter to `len` method.
67+
Wonder why sometimes you call functions by adding `.` at the end of the string (like `"Ola".upper()`) and sometimes you first call a function and place the string in parentheses? Well, in some cases, functions belong to objects, like `upper` that can only be performed on Strings. In this case, we call the function a __method__. Other times, functions don't belong to anything specific and can be used on different types of objects, just like `len`. That's why we're giving `"Ola"` as a parameter to `len` function.
6868

6969
### Summary
7070

7171
Ok, enough of strings. So far you've learned about:
7272

7373
- __the prompt__ - typing commands (code) into prompt give you Python answers
7474
- __numbers and strings__ - in Python it's math and text objects
75-
- __methods__ - are actions in Python. You've used both English-language methods (upper, len) and symbolic ones (+, *).
75+
- __functions__ - are actions in Python. You've used both English-language functions (upper, len) and symbolic ones (+, *).
7676

77-
That's the basic of every programming language you learn. Ready for something harder? We bet you are!
77+
That's the basics of every programming language you learn. Ready for something harder? We bet you are!
7878

7979
## Errors
8080

@@ -90,16 +90,16 @@ We got our first error! It says that objects of type "int" (integers, whole numb
9090
>>> len(str(304023))
9191
6
9292

93-
It worked! We used `str` method inside of `len` method. `str` is converting everything to strings.
93+
It worked! We used `str` function inside of `len` function. `str` is converting everything to strings.
9494

95-
- `str` method convert things into __strings__
96-
- `int` method convert things into __integers__
95+
- The `str` function converts things into __strings__
96+
- The `int` function converts things into __integers__
9797

98-
> Important: we can convert numbers into text, but we can't convert text into numbers.
98+
> Important: we can convert numbers into text, but we can't necessarily convert text into numbers - what would `int('hello')` be anyway?
9999
100100
## Variables
101101

102-
There is a concept in programming called variables. A variable is nothing more than a name for something so you can use it easier. Programmers use these variables to store data, make their code more readable and to not forget what something is.
102+
An important concept in programming is variables. A variable is nothing more than a name for something so you can use it later. Programmers use these variables to store data, make their code more readable and to not help them remember what things are.
103103

104104
Let's say we want to create a new variable called `name`:
105105

@@ -112,13 +112,13 @@ As you've noticed, your program didn't return anything like it did before. How d
112112
>>> name
113113
'Ola'
114114

115-
Yikes! Your first variable :)! You can always change what it is:
115+
Yippee! Your first variable :)! You can always change what it is:
116116

117117
>>> name = "Sonja"
118118
>>> name
119119
'Sonja'
120120

121-
You can use it in methods too:
121+
You can use it in functions too:
122122

123123
>>> len(name)
124124
5
@@ -134,7 +134,7 @@ Play with this for a while and see what you can do!
134134

135135
## Lists
136136

137-
Beside strings and integers, Python has all sorts of different types of objects. Now we're going to introduce one called __list__. List is the exact thing you think about now: object that is a list of objects :)
137+
Beside strings and integers, Python has all sorts of different types of objects. Now we're going to introduce one called __list__. Lists are exactly what you think they are: they are objects which are lists of other objects :)
138138

139139
Go ahead and create a list:
140140

@@ -145,7 +145,7 @@ Yes, it's empty. Not very useful, right? Let's create a list of lottery numbers.
145145

146146
>>> lottery = [3, 42, 12, 19, 30, 59]
147147

148-
All right, we have a list! What can we do with it? Let's see how many lottery numbers there are in a list. Do you have an idea which method you should use for that? You know this already!
148+
All right, we have a list! What can we do with it? Let's see how many lottery numbers there are in a list. Do you have an idea which function you should use for that? You know this already!
149149

150150
>>> len(lottery)
151151
6
@@ -154,7 +154,7 @@ Yes! `len` can give you a number of objects in a list. Handy, right? Maybe we wi
154154

155155
>>> lottery.sort()
156156

157-
This doesn't return anything... because we didn't print it! Try this:
157+
This doesn't return anything, it just changed the list in place. Let's print it out again and see what happened:
158158

159159
>>> print(lottery)
160160
[3, 12, 19, 30, 42, 59]
@@ -173,14 +173,14 @@ Easy, right? If you want to add something to the list, you can do this by typing
173173
>>> print(lottery)
174174
[59, 42, 30, 19, 12, 3, 199]
175175

176-
If you want to read only the first number, you can do this by using index. The first object of the list is an object number 0, next one is 1, and so on. Try this:
176+
If you want to read only the first number, you can do this by using __indexes__. Computer people like to start counting at 0, so the first object of the list is at number 0, next one is 1, and so on. Try this:
177177

178178
>>> print(lottery[0])
179179
59
180180
>>> print(lottery[1])
181181
42
182182

183-
As you can see, you can access different objects in your list by using its name and index number inside of brackets.
183+
As you can see, you can access different objects in your list by using its name and index number inside of square brackets.
184184

185185
You can find a list of all available list methods here in Python documentation: https://docs.python.org/3/tutorial/datastructures.html
186186

@@ -241,9 +241,9 @@ You can give Python as many numbers to compare as you want, and it will give you
241241

242242
## Boolean
243243

244-
Accidently, you just learned about a new type of object in Python. It's __boolean__ -- probably the easiest type there is.
244+
Accidently, you just learned about a new type of object in Python. It's called a __boolean__ -- probably the easiest type there is.
245245

246-
Boolean can be only two things:
246+
There are only two boolean objects::
247247
- True
248248
- False
249249

@@ -336,21 +336,21 @@ See what happened there?
336336
In the last three exercises you learned about:
337337

338338
- __comparing things__ - in Python you can compare things together using `>`, `>=`, `==`, `<=`, `<` and `and`, `or` operators
339-
- __boolean__ - type of object that can only held two values: `True` and `False`
340-
- __if...elif...else__ - statements that are helpful to execute only code that meet given conditions.
339+
- __boolean__ - a type of object that can only have two values: `True` and `False`
340+
- __if...elif...else__ - statements that allow you to execute code only when certain conditions are met.
341341

342342
Time for the last part of this chapter!
343343

344-
## Methods (functions)
344+
## Your own functions!
345345

346-
Remember about methods like `len` that you can execute in Python? Well, good news, you will learn how to write your own functions now!
346+
Remember functions like `len` that you can execute in Python? Well, good news, you will learn how to write your own functions now!
347347

348348
A function is a set of instructions that Python should execute. Each function in Python starts with the keyword `def`, has a name and can have some parameters. Let's start with an easy one:
349349

350350
>>> def hi():
351351
...
352352

353-
As you can see, there are the dots again! This means that nothing has really happenned yet... and yes, we need to do a `TAB` before giving our instructions:
353+
As you can see, there are the dots again! This means that nothing has really happened yet... and yes, we need to do a `TAB` before giving our instructions:
354354

355355
>>> def hi():
356356
... print('Hi there!')
@@ -403,7 +403,7 @@ Let's call the function now:
403403
>>> hi("Rachel")
404404
Hi Rachel!
405405

406-
Congratulations! You just learned how to write functions :)!
406+
Congratulations! You just learned how to write functions :)!
407407

408408
## Loops
409409

@@ -435,6 +435,7 @@ Dots again! Remember what goes after dots? Yes, tab :)
435435
Hi Ola!
436436
Next girl
437437
Hi You!
438+
Next girl
438439

439440
As you can see, everything you will put inside `for` statement with `tab` will be repeated for every element of the list `girls`.
440441

@@ -449,7 +450,7 @@ You can also do `for` on numbers using `range` method:
449450
4
450451
5
451452

452-
`range` is a method that creates a list of numbers from one number to another (numbers are given by you as parameters).
453+
`range` is a function that creates a list of numbers from one number to another (numbers are given by you as parameters).
453454

454455
## Summary
455456

0 commit comments

Comments
 (0)