Skip to content

Commit 9ce111d

Browse files
committed
Run python introduction chapter through Hemingway
1 parent 137f8fa commit 9ce111d

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

en/python_introduction/README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Using double quotes:
6363
>>> "Runnin' down the hill"
6464
"Runnin' down the hill"
6565

66-
or escaping apostrophe with a backslash (`\`):
66+
or escaping apostrophe with a backslash (`\`):
6767

6868
>>> 'Runnin\' down the hill'
6969
"Runnin' down the hill"
@@ -177,7 +177,7 @@ As we'll see later, `print()` is also useful when we want to print things from i
177177

178178
## Lists
179179

180-
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 :)
180+
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: objects which are lists of other objects :)
181181

182182
Go ahead and create a list:
183183

@@ -372,7 +372,7 @@ There are only two Boolean objects:
372372
- True
373373
- False
374374

375-
But for Python to understand this, you need to always write it as True (first letter uppercased, with the rest of the letter lowercased). __true, TRUE, tRUE won't work -- only True is correct.__ (The same applies to False as well, of course.)
375+
But for Python to understand this, you need to always write it as 'True' (first letter uppercased, with the rest of the letter lowercased). __true, TRUE, tRUE won't work -- only True is correct.__ (The same applies to 'False' as well, of course.)
376376

377377
Booleans can be variables, too! See here:
378378

@@ -417,7 +417,7 @@ Earlier, we picked out a code editor from the [code editor](../code_editor/READM
417417
print('Hello, Django girls!')
418418
```
419419

420-
> **Note** You should notice one of the coolest thing about code editors: colours! In the Python console, everything was the same colour, but now you should see that the `print` function is a different colour from the string inside it. That's called "syntax highlighting", and it's a really useful helping hand when coding. Watch out for the colour of things, and you'll get a hint for when you forget to close a string, or make a typo in a keyword name (like the `def` in a function, which we'll see below). This is one of the reasons we use a code editor :)
420+
> **Note** You should notice one of the coolest thing about code editors: colours! In the Python console, everything was the same colour, now you should see that the `print` function is a different colour from the string. This is called "syntax highlighting", and it's a really useful feature when coding. The colour of things will give you hints, such as unclosed strings, or a typo in a keyword name (like the `def` in a function, which we'll see below). This is one of the reasons we use a code editor :)
421421
422422

423423
Obviously, you're a pretty seasoned python developer now, so feel free to write some code that you've learned today.
@@ -466,14 +466,14 @@ If we saved this and ran it, we'd see an error like this:
466466
^
467467
SyntaxError: unexpected EOF while parsing
468468

469-
Python expects us to give further instructions to it which are supposed to be executed if the condition `3 > 2` turns out to be true (or `True` for that matter). Let’s try to make Python print “It works!”. Change your code in your **python_intro.py** file to this:
469+
Python expects us to give further instructions to it which are executed if the condition `3 > 2` turns out to be true (or `True` for that matter). Let’s try to make Python print “It works!”. Change your code in your **python_intro.py** file to this:
470470

471471
```python
472472
if 3 > 2:
473473
print('It works!')
474474
```
475475

476-
Notice how we've indented the next line of code by 4 spaces? We need to do this so Python knows what code to run if the code results in true. You can do one space, but nearly all Python programmers do 4 to make things look neat. A single tab will also count as 4 spaces.
476+
Notice how we've indented the next line of code by 4 spaces? We need to do this so Python knows what code to run if the result is true. You can do one space, but nearly all Python programmers do 4 to make things look neat. A single tab will also count as 4 spaces.
477477

478478
Save it and give it another run:
479479

@@ -491,7 +491,7 @@ else:
491491
print('5 is not greater than 2')
492492
```
493493

494-
When this was run it would print out:
494+
When this is ran it will print out:
495495

496496
$ python3 python_intro.py
497497
5 is indeed greater than 2
@@ -530,7 +530,7 @@ Time for the last part of this chapter!
530530

531531
Remember functions like `len()` that you can execute in Python? Well, good news, you will learn how to write your own functions now!
532532

533-
A function is a sequence of instructions that Python should execute. Each function in Python starts with the keyword `def`, is given a name and can have some parameters. Let's start with an easy one. Replace the code in **python_intro.py** with the following:
533+
A function is a sequence of instructions that Python should execute. Each function in Python starts with the keyword `def`, is given a name, and it can have some parameters. Let's start with an easy one. Replace the code in **python_intro.py** with the following:
534534

535535
```python
536536
def hi():
@@ -570,7 +570,7 @@ def hi(name):
570570
hi()
571571
```
572572

573-
As you can see, we needed to put two indents before the `print` function, because `if` needs to know what should happen when the condition is met. Let's see how it works now:
573+
Remember: The `print` function is indented four spaces within the `if` statement. This is because the function runs when the condition is met. Let's see how it works now:
574574

575575
$ python3 python_intro.py
576576
Traceback (most recent call last):
@@ -586,7 +586,7 @@ Let's fix it at the bottom of the file:
586586
hi("Ola")
587587
```
588588

589-
and run it again:
589+
And run it again:
590590

591591
$ python3 python_intro.py
592592
Hi Ola!
@@ -597,12 +597,12 @@ And if we change the name?
597597
hi("Sonja")
598598
```
599599

600-
and run it:
600+
And run it:
601601

602602
$ python3 python_intro.py
603603
Hi Sonja!
604604

605-
Now what do you think will happen if you write another name in there? (Not Ola or Sonja) Give it a try and see if you're right. It should print out this:
605+
Now, what do you think will happen if you write another name in there? (Not Ola or Sonja) Give it a try and see if you're right. It should print out this:
606606

607607
Hi anonymous!
608608

@@ -622,11 +622,11 @@ Let's call the code now:
622622
$ python3 python_intro.py
623623
Hi Rachel!
624624

625-
Congratulations! You just learned how to write functions :)!
625+
Congratulations! You just learned how to write functions! :)
626626

627627
## Loops
628628

629-
That's the last part already. That was quick, right? :)
629+
This is the last part already. That was quick, right? :)
630630

631631
As we mentioned, programmers are lazy, they don't like to repeat themselves. Programming is all about automating things, so we don't want to greet every person by their name manually, right? That's where loops come in handy.
632632

@@ -642,7 +642,7 @@ We want to greet all of them by their name. We have the `hi` function to do that
642642
for name in girls:
643643
```
644644

645-
The ```for``` statement behaves similarly to the ```if``` statement, code below both of these need to be indented four spaces.
645+
The ```for``` statement behaves similarly to the ```if``` statement; code below both of these need to be indented four spaces.
646646

647647
Here is the full code that will be in the file:
648648

@@ -656,7 +656,7 @@ for name in girls:
656656
print('Next girl')
657657
```
658658

659-
and when we run it:
659+
And when we run it:
660660

661661
$ python3 python_intro.py
662662
Hi Rachel!
@@ -691,7 +691,7 @@ Note that the second of these two numbers is not included in the list that is ou
691691

692692
## Summary
693693

694-
That's it. __You totally rock!__ This really wasn't so easy, so you should feel proud of yourself. We're definitely proud of you for making it to here!
694+
That's it. __You totally rock!__ This was a tricky chapter, so you should feel proud of yourself. We're definitely proud of you for making it this far!
695695

696696
You might want to briefly do something else - stretch, walk around for a bit, rest your eyes - before going on to the next chapter. :)
697697

0 commit comments

Comments
 (0)