In this program, we will take email as string input and extract the name from the email address.
Steps to solve the program
- Take an email id of a student as string input.
- Find the index number of “@” using index().
- Create an empty string.
- Add characters from the email id to the empty string using for loop up to the index of “@”.
- Add only alphabets not numbers use isalpha() for this purpose.
- Print the output.
Output :