How to divide the entered data into variables?

I need to make the program understand commands, i.e.: if I enter for example "search 15", then a='search' and b='15' it is also desirable to understand commands such as e.g. 'add in an emergency 15' , and in this case, variables would be equal to a='add in an emergency' and b='15' If there's any easier way to split the command and the argument I am grateful for the explanation of how you can implement this method
March 12th 20 at 08:01
3 answers
March 12th 20 at 08:03
Solution
the method split(" ")
March 12th 20 at 08:05
Solution
a, b = 'add to CHS 15'.rsplit(maxsplit=1)
Read docks.
March 12th 20 at 08:07
looking where to enter, if you run from the command line, then maybe it makes sense to bother with the sys.argv

Find more questions by tags Python