The components of a tuple can be assigned to individualvariables.
So, for example, if we create a point in 3D space:
pt = (1, 2, 3)
then we can later assign its components to individualvariables:
x, y, z = pt
The str.partition method can be used to separate the componentsof a string:
>>> help(str.partition) Help on method_descriptor:partition(…) S.partition(sep) -> (head, sep, tail) Search forthe separator sep in S, and return the part before it, theseparator itself, and the part after it. If the separator is notfound, return S and two empty strings.
Write a function get_names() which prompts the user to entertheir name, and then returns a tuple containing their first andlast names. You must use str.partition to separate the user’s firstand last names. You must ‘unpack’ the result of str.partition intoseparate variables. You may assume that the user only enters twonames.(using python)