Skip to content

Commit 7878c8a

Browse files
authored
Update If.md
1 parent 294d1dc commit 7878c8a

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

Tutorials/If.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ After that, add two equal signs.
1818
if apples ==
1919
```
2020

21-
If you want it equal to a integer, add a space and the integer. After that, put a colon. If you want to view the variable tutorial, click [here](https://github.com/codingtutorials/Python/blob/master/Tutorials/Variables.md)
21+
If you want it equal to a integer, add a space and the integer. If you want it less than or equal to, add the appropriate signs. After that, put a colon. If you want to view the variable tutorial, click [here](https://github.com/codingtutorials/Python/blob/master/Tutorials/Variables.md)
2222

2323
```python
2424
if apples == 1:
@@ -76,3 +76,22 @@ Run:
7676
You have 1 apples
7777
You have 2 apples
7878
```
79+
80+
## Example 4:
81+
```python
82+
apples = 1
83+
if apples == 1:
84+
print("You have",apples,"apples")
85+
apples = 2
86+
if apples == 2:
87+
print("You have",apples,"apples")
88+
apples += 1
89+
if apples == 3:
90+
print("You have",apples,"apples")
91+
```
92+
Run:
93+
```
94+
You have 1 apples
95+
You have 2 apples
96+
You have 3 apples
97+
```

0 commit comments

Comments
 (0)