Get a list of mobile numbers from the string

In this program, we will take a string as input and get a list of mobile numbers from the given string.

Steps to solve the program
  1. Take a list as input.
  2. Convert the string into a list using split() and create an empty list.
  3. Use for loop to iterate over every word in the list.
  4. If the length of the word is 10 and that word contains all numbers then add that word to the empty list.
  5. Print the output.

Output :

get all the email id’s from given string

Leave a Comment