> For the complete documentation index, see [llms.txt](https://docs.arkannis.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arkannis.net/programming/courses/python-pcap-31-03-course/control-flow/if-and-else-statements.md).

# If & Else Statements

## If & Else statements

* Control flow is controlling which lines of code run in a program
* With conditionals such as if, else

```python
if 5 < 6:
	print('yes 5 is less than 6')
else:
	print('this will never be printed') # in code editor will say that code is not reachable
```

### Always going to run:

```python
if True:
	print("this will always be printed")
else:
	print("this will never be printed")
```

### Surrounding conditionals with paranthesies:

```python
elephant = 800
hippo = 900
if (elephant < hippo and (3 > 2)):
	print('if statement evaluated to True')
else:
	print('if statement evaluated to False')
```
