Skip to content

Commit b823af5

Browse files
authored
Update code sections with ```python
1 parent 51743ae commit b823af5

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

003-Variables.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Python is a dynamically typed programming language meaning that you do not need
55
## How to make a variable
66

77
A variable is created by giving it a name and then assigning its contents to it with a single equals sign, for example:
8-
<pre><code>example = "value"</code></pre>
9-
8+
```python
9+
example = "value"
10+
```
1011
## What information can variables hold?
1112

1213
Variables can hold several different types of values and information, each of which will have its very own chapter in the coming series, however here they are in simple bullet form.
@@ -23,25 +24,26 @@ Variables can be called upon in order to use the values for various parts of a p
2324
## How to format a variable
2425

2526
Variables should stick to specific formatting rules, so that your code not only works, but can also be read by other users. To assign a variable, remember that the letters are CASE SENSITIVE. So:
26-
27-
<pre><code> cat = "paws" </code></pre>
28-
27+
```python
28+
cat = "paws"
29+
```
2930
is completely different to:
30-
31-
<pre><code> Cat = "paws" </code></pre>
32-
31+
```python
32+
Cat = "paws"
33+
```
3334
Variables should always start with a letter, can never have an empty space and can contain numbers. If spaces are needed to make the variable more understandable use an underscore like this example:
34-
35-
<pre><code> my_first_variable = "I did it!" </code></pre>
36-
35+
```python
36+
my_first_variable = "I did it!"
37+
```
3738
For strings, add quote marks around the string (see string chapter for more info on this.) For numbers there is no need for quotes, for example:
3839

39-
<pre><code>numbers = 132
40+
```python
41+
numbers = 132
4042
more_numbers = 567
4143
even_more_numbers = 3.5632
4244
and_again = 1
43-
string = "Strings have single or double quotes around them"</code></pre>
44-
45+
string = "Strings have single or double quotes around them"
46+
```
4547

4648

4749

0 commit comments

Comments
 (0)