Skip to content

Commit 9db8ee7

Browse files
committed
Add more stuff
1 parent e104274 commit 9db8ee7

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ probably want to read
1414
This tutorial uses Python 3. Python 2 is getting outdated all the time,
1515
and more and more projects are moving to Python 3. There are a few
1616
popular libraries that don't support Python 3 that well at the time of
17-
writing this, but you don't need to worry about that just yet. They will
18-
probably support Python 3 by the time you've learned the basics and you
19-
may actually need them.
17+
writing this, but you don't need to worry about that just yet. They
18+
will probably support Python 3 by the time you've learned the basics
19+
and you may actually need them.
2020

2121
Here's a list of chapters in this tutorial. Read them one by one in the
2222
order they are listed. **If you jump to a chapter without reading

if.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,50 @@
22

33
### Using if statements
44

5-
Back in chapter 2, we learned what the boolean values True and False are.
5+
Now we know what True and False are.
66

77
```py
88
>>> 1 == 1
99
True
1010
>>> 1 == 2
1111
False
1212
>>>
13-
```
14-
15-
We also learned how to assign them to variables.
16-
17-
```py
1813
>>> its_raining = True
1914
>>> its_raining
2015
True
2116
>>>
2217
```
2318

24-
But what if we want to execute different code depending on something? That's when `if` comes in.
19+
But what if we want to execute different code depending on something?
20+
That's when `if` comes in.
2521

2622
```py
2723
>>> its_raining = True
2824
>>> if its_raining:
29-
print("It's raining!")
30-
31-
25+
... print("It's raining!")
26+
...
3227
It's raining!
3328
>>> its_raining = False
3429
>>> if its_raining:
35-
print("It's raining!") # nothing happens
30+
... print("It's raining!") # nothing happens
31+
...
32+
>>>
33+
```
3634

35+
The prompt changed from `>>>` to `...`. It meant that Python was
36+
expecting me to keep typing. When I was done, I just pressed Enter
37+
twice. My code was execute and the prompt was restored to `>>>`.
3738

38-
>>>
39-
```
39+
At this point it's easier to put your code into a file and use it
40+
there. If you use IDLE, go to File at top left and select New File, or
41+
just press Ctrl+N.
42+
43+
![New File in IDLE](idle-new.png)
4044

41-
After typing the line with print we need to press Enter twice to actually run the code we wrote. IDLE also indents everything we want to run if it's raining.
45+
If you are not using IDLE, open whatever editor you have installed, or
46+
install
4247

43-
At this point it's easier to put your code into a file and use it there. The file's content would be like this:
48+
The file's content would be like this:
4449

4550
```py
4651
its_raining = True

0 commit comments

Comments
 (0)