Skip to content

Commit 2e40d9f

Browse files
Fixed spelling mistakes and rephrased one sentence in 4.md.
1 parent 5edf137 commit 2e40d9f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

2.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 2. Strings, variables, booleans and None
1+
# 2. Strings, variables, Booleans and None
22

33
### Strings
44

@@ -20,7 +20,7 @@ NameError: name 'hello' is not defined
2020
>>>
2121
```
2222

23-
But putting the text in quotes works. You can use single quotes or double quotes. They work the same way, but things entered with double quotes will be echoed back with single quotes. Pieces of text inside quotes with text inside them are known as strings.
23+
But putting the text in quotes works. You can use single quotes or double quotes. They work the same way, but things entered with double quotes will be echoed back with single quotes. Pieces of text inside quotes are known as strings.
2424

2525
```py
2626
>>> 'hello'
@@ -65,7 +65,7 @@ TypeError: Can't convert 'int' object to str implicitly
6565
>>>
6666
```
6767

68-
You can also use `len` to get the length of a string in characters. This will come in handy later in this tutorial.
68+
You can also use `len()` to get the length of a string in characters. This will come in handy later in this tutorial.
6969

7070
```py
7171
>>> len('hello')
@@ -98,7 +98,7 @@ Variables are easy to understand. They simply contain data. _[*]_
9898
>>>
9999
```
100100

101-
_[*] In fact, variables point to data stored in the computer's memory. All strings, integers and other objects are just data in the RAM. See [this video](https://www.youtube.com/watch?v=_AEJHKGk9ns) for more info._
101+
_[*] In fact, variables point to data stored in the computer's memory. All strings, integers and other objects are just data in RAM. See [this video](https://www.youtube.com/watch?v=_AEJHKGk9ns) for more info._
102102

103103
Variable names can be multiple characters long. They can contain uppercase characters and special characters, but most of the time you should be using simple, lowercase variable names. You can also use underscores.
104104

@@ -171,7 +171,7 @@ Now you also understand why typing hello to the prompt didn't work in the beginn
171171
>>>
172172
```
173173

174-
### booleans and None
174+
### Booleans and None
175175

176176
In Python, and many other programming languages, `=` is assigning and `==` is comparing. `a = 1` sets a to 1 and `a == 1` checks if a is 1.
177177

4.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ while its_raining:
171171
# We'll jump back to the second line from here
172172
```
173173

174-
Don't get scared when you ran the program. Like I wrote in the introduction, this will not destroy or crash your computer. It just repeats the same thing quickly. You can interrupt the program by hitting Ctrl+C. You'll get an error message saying that a `KeyboardInterrupt` occurred, that's normal. The output is like this:
174+
Don't get scared when you run the program. Like I wrote in the introduction, this will not destroy or crash your computer. It just repeats the same thing quickly. You can interrupt the program by hitting Ctrl+C. You'll get an error message saying that a `KeyboardInterrupt` occurred, that's normal. The output is like this:
175175

176176
>>> ================================ RESTART ================================
177177
>>>
@@ -204,7 +204,7 @@ Again, you can interrupt the program with Ctrl+C.
204204
_[*] There are many ways to interrupt while loops, including `while True` loops. `break` will end the innermost loop it's in, and `exit()` will quit the whole program._
205205

206206
### Exercises
207-
1. Make a program that asks for a password and prints `Welcome!`, `Access denied` or `You didn't enter anything` depending on did the user enter the correct password, a wrong password or nothing at all by pressing Enter without typing anything.
207+
1. Make a program that asks for a password and prints `Welcome!`, `Access denied` or `You didn't enter anything` depending on whether the user entered the correct password, a wrong password, or nothing at all by pressing Enter without typing anything.
208208
2. Make a program that asks for username and password and checks them. Make users "foo" and "bar" with passwords "biz" and "baz".
209209
3. Make a program that asks for username and password and gives the user an infinite number of attempts, so the user can always try again if he mistypes the password.
210210
4. Can you limit the number of attempts to 3?

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ Most importantly, when learning a programming language you need to **experiment
1717
Here's a list of chapters in this tutorial:
1818

1919
1. [Installing Python and using it as a calculator](1.md)
20-
2. [Strings, variables, booleans and None](2.md)
20+
2. [Strings, variables, Booleans and None](2.md)
2121
3. [Using functions and storing code in files](3.md)
2222
4. [If, elif, else and while](4.md)

0 commit comments

Comments
 (0)