Skip to content

Commit b156335

Browse files
committed
Typos, fixes, etc
1 parent 79fc8ee commit b156335

1 file changed

Lines changed: 27 additions & 27 deletions

File tree

try_python/README.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ Let's write some code!
66

77
To start tinkering with Python, we need to open up a *prompt* on your computer. On Mac OS X you can do this by launching `Terminal` application (It's in Applications → Utilities). On Windows you need to go to Start menu → All Programs → Accessories → Command Prompt. On Linux, it's probably under Applications → Accessories → Terminal.
88

9-
Black window should pop up on your screen. This window is waiting for a command from you. We want to open up a Python console, so type in `python` and hit Enter.
9+
A window should pop up on your screen. This window is a prompt, waiting for commands from you. We want to open up a Python console, so type in `python` and hit Enter.
1010

1111
(workshops) ~$ python
1212
Python 3.4.0 (...)
1313
Type "copyright", "credits" or "license" for more information.
1414
>>>
1515

16-
Earlier we were working in the operating system’s command line and we could give commands. The prompt was `~$`. After running the python command, prompt changed to `>>>`. For us that means that for now we may use commands only in Python language. You don't have to type in `>>>` - Python will do that for you.
16+
After running the python command, prompt changed to `>>>`. For us it means that for now we may use commands only in Python language. You don't have to type in `>>>` - Python will do that for you.
1717

1818
## Your first Python command!
1919

@@ -22,14 +22,14 @@ Let's start with something really simple. For example, try typing some math, lik
2222
>>> 2 + 3
2323
5
2424

25-
Nice! See how the answer popped out? Python knows some math. You could try other commands like:
25+
Nice! See how the answer popped out? Python knows math! You could try other commands like:
2626
- `4 * 5`
2727
- `5 - 1`
2828
- `40 / 2`
2929

3030
Have fun with this for a little while and then get back here :)
3131

32-
As you can see, Python is a great calculator. If you're wonder what alse you can do...
32+
As you can see, Python is a great calculator. If you're wonder what else you can do...
3333

3434
## Strings
3535

@@ -38,7 +38,7 @@ Maybe your name? Type your first name in quotes like this:
3838
>>> "Ola"
3939
'Ola'
4040

41-
You now created your first string! It's a set of characters that can be processed by a computer. The string must always begin and end with the same character. This may be an apostrophe (`'`) or double quotes (`"`). It has no effect on the value of the string - double quotes or apostrophes are not a part of string, they only indicate that it is a string.
41+
You now created your first string! It's a set of characters that can be processed by a computer. The string must always begin and end with the same character. This may be an apostrophe (`'`) or double quotes (`"`) - they tell Python that it is a string.
4242

4343
Strings can be added. Try this:
4444

@@ -62,7 +62,7 @@ If you want to get a number of letters in your name, there is a method for that
6262
>>> len("Ola")
6363
3
6464

65-
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 add 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.
65+
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 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.
6666

6767
### Summary
6868

@@ -76,41 +76,41 @@ That's the basic of every programming language you learn. Ready for something ha
7676

7777
## Errors
7878

79-
Let's try something. Can we know the lenght of a number, the same way we learn the lenght of our name? Try typing `len(304023)` and hit Enter:
79+
Let's try something. Can we know the length of a number, the same way we learn about the length of our name? Try typing `len(304023)` and hit Enter:
8080

8181
>>> len(304023)
8282
Traceback (most recent call last):
8383
File "<stdin>", line 1, in <module>
8484
TypeError: object of type 'int' has no len()
8585

86-
We got our first error! It says that objects of type "int" (integers, whole numbers) doesn't have a lenght. Well.. so what can we do know? Maybe we can write our number as string? Strings have lenght, right?
86+
We got our first error! It says that objects of type "int" (integers, whole numbers) doesn't have a length. So what can we do know? Maybe we can write our number as string? Strings have length, right?
8787

8888
>>> len(str(304023))
8989
6
9090

91-
It worked! We used `str` method inside of `len` method. `str` is converting everything to Strings.
91+
It worked! We used `str` method inside of `len` method. `str` is converting everything to strings.
9292

9393
- `str` method convert things into __strings__
9494
- `int` method convert things into __integers__
9595

96-
As long as we can convert numbers into text, we can't convert text into numbers.
96+
> Important: we can convert numbers into text, but we can't convert text into numbers.
9797
9898
## Variables
9999

100-
There is a concept in programming: variable. This is nothing more than a name for something so you can use the name rather than the something as you code. Programmers use these variable names to make their code more readable and so they won't forget what something is.
100+
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.
101101

102102
Let's say we want to create a new variable called `name`:
103103

104104
>>> name = "Ola"
105105

106106
You see? It's easy! Simply: name equals Ola.
107107

108-
As you've noticed, your program didn't return anything as it did before. How do we now that the variable actually is there? Simply enter `name` and hit Enter:
108+
As you've noticed, your program didn't return anything like it did before. How do we now that the variable actually is there? Simply enter `name` and hit Enter:
109109

110110
>>> name
111111
'Ola'
112112

113-
Yikes! Your first variable :) You can always change what it means:
113+
Yikes! Your first variable :) You can always change what it is:
114114

115115
>>> name = "Sonja"
116116
>>> name
@@ -139,20 +139,20 @@ Go ahead and create a list:
139139
>>> []
140140
[]
141141

142-
Yes, it's empty. Not very useful, right? Let's create a list of lottery numbers. We don't want to repear ourselves all the time, so we will put it in a variable, too:
142+
Yes, it's empty. Not very useful, right? Let's create a list of lottery numbers. We don't want to repeat ourselves all the time, so we will put it in a variable, too:
143143

144144
>>> lottery = [3, 42, 12, 19, 30, 59]
145145

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

148148
>>> len(lottery)
149149
6
150150

151-
Yes! `len` can give you a number of objects in a list. Handy, right? Let's sort this list now.
151+
Yes! `len` can give you a number of objects in a list. Handy, right? Maybe we will sort it now:
152152

153153
>>> lottery.sort()
154154

155-
This doesn't return anything... because we didn't print it! Let's try this:
155+
This doesn't return anything... because we didn't print it! Try this:
156156

157157
>>> print(lottery)
158158
[3, 12, 19, 30, 42, 59]
@@ -190,11 +190,11 @@ Awesome! You know a lot about programming now. In the last part you learned abou
190190
- __variables__ - names for objects that allow to code more easily and make your code more readable
191191
- __lists__ - list of objects stored in particular order.
192192

193-
Exicted for the next part? :)
193+
Excited for the next part? :)
194194

195195
## Compare things
196196

197-
The big part of programming includes comparing things together. What's the easiest thing to compare? Numbers, of course. Let's see how it works:
197+
The big part of programming includes comparing things. What's the easiest thing to compare? Numbers, of course. Let's see how it works:
198198

199199
>>> 5 > 2
200200
True
@@ -207,9 +207,9 @@ The big part of programming includes comparing things together. What's the easie
207207

208208
We gave Python some numbers to compare. As you can see, Python can compare not only numbers, but it can also compare method results. Nice, huh?
209209

210-
Do you wonder why we put two `==` next to each other to compare if numbers are equal? We use single `=` for asserting value to variables, so Python would think that we're trying to do that. You always, __always__ need to put two `==` if you want to check if things are equal to each other.
210+
Do you wonder why we put two `==` next to each other to compare if numbers are equal? We use single `=` for assigning value to variables, so Python would think that we're trying to do that. You always, __always__ need to put two `==` if you want to check if things are equal to each other.
211211

212-
Let's give Python two more tasks:
212+
Give Python two more tasks:
213213

214214
>>> 6 >= 12 / 2
215215
True
@@ -223,7 +223,7 @@ Let's give Python two more tasks:
223223
- x `<=` y - x is smaller or equal to y
224224
- x `>=` y - x is greater or equal to y
225225

226-
Awesome! Wanna do one more? Let's try this:
226+
Awesome! Wanna do one more? Try this:
227227

228228
>>> 6 > 2 and 2 < 3
229229
True
@@ -234,12 +234,12 @@ Awesome! Wanna do one more? Let's try this:
234234

235235
You can give Python as many numbers to compare as you want, and he will give you an answer! Pretty smart, right?
236236

237-
- __and__ - if you use `and` operator, both of the comparisions have to be True in order for the whole thing to be True
238-
- __or__ - if you use `or` operator, only one of the comparisions has to be True in order for the whole thing to be True
237+
- __and__ - if you use `and` operator, both of the comparisons have to be True in order for the whole thing to be True
238+
- __or__ - if you use `or` operator, only one of the comparisons has to be True in order for the whole thing to be True
239239

240240
## Boolean
241241

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

244244
Boolean can be only two things:
245245
- True
@@ -270,7 +270,7 @@ Congrats! You can know move on to the essence of programming:
270270

271271
## If...elif...else
272272

273-
Lots of things in code should only be exectured when given conditions are met. That's why Python has something called __if statements__.
273+
Lots of things in code should only be executed when given conditions are met. That's why Python has something called __if statements__.
274274

275275
Try this:
276276

@@ -388,7 +388,7 @@ As you can see, we needed to put two tabs before `print` function, because `if`
388388
>>> hi("Anja")
389389
Hi anonymous!
390390

391-
Awesome, right? This way you don't have to repeat yourself everytime you want to change the name. And that's exactly why we need functions - you never want to repeat your code!
391+
Awesome, right? This way you don't have to repeat yourself every time you want to change the name. And that's exactly why we need functions - you never want to repeat your code!
392392

393393
Let's do something smarter -- there is more names than two, and writing a condition for each would be hard, right?
394394

0 commit comments

Comments
 (0)