Hi everyone I wonder if you can help with my problem.
I am defining a function which takes a string and converts it into 5 items in a tuple. The function will be required to take a number of strings, in which some of the items will vary in length. How would I go about doing this as using the indexes of the string does not work for every string.
As an example -
I want to convert a string like the following:
Doctor E212 40000 Peter David Jones
The tuple items of the string will be:
Job(Doctor), Department(E212), Pay(40000), Other names (Peter David), Surname (Jones)
However some of the strings have 2 other names where others will have just 1.
How would I go about converting strings like this into tuples when the other names can vary between 1 and 2?
I am a bit of a novice when it comes to python as you can probably tell ;)