> For the complete documentation index, see [llms.txt](https://lauradang.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lauradang.gitbook.io/notes/python/string-tricks.md).

# String Tricks

## Using `ord`

Let's say we want to make an array from 0 to 25 consisting of either the alphabet in lower case or upper case.

```python
ord("a") - ord("a") 
>> 0

ord("b") - ord("a")
>> 1

...

ord("A") - ord("A")
>> 0

ord("B") - ord("A")
>> 1

...
```
