00:01
As mentioned, we have to take user's name in first and last format.
00:05
For that, first of all, we'll create a variable.
00:07
Let's call it name in which we will store the user's name.
00:13
In order to take input from the user, we'll be using the input function.
00:18
Let's say we are giving a message, enter your name.
00:25
Next, we have to split this name and store it in the form of list.
00:33
So for example, let's say we are taking a variable called fname.
00:40
In order to split this name, we will be using the split function.
00:48
This method is used to divide any string and store it in the form of list.
00:53
We can mention any separator over here, for example, full stop comma.
00:57
By default, it takes whitespace.
01:00
Since we have to separate over here the name, first name and the last name using a whitespace, so we are not mentioning anything over here.
01:09
The next step is to check whether the name entered by the user is valid or not...