Is it possible to do a function that detects the final part of an input to differentiate it from others? : I want to make a piece of code that detects the final part of an input to define what command to execute.

I am asking this like that because I have no clue of what to even start from. I've not tried anything, and I would like to know if its even possible before I start. My piece of code is what I know would work, but I want to make a lot of them, so I was wondering if you could possibly make it shorter than just adding the if's by hand, as if with a function.

```python
command = input()
if command == "add role_1"
     role = 1
```