Course Solutions Uncategorized (Solved) : Fill Pattern Following Function Identify String Valid Phone Number Us Valid Phone Number U Q37428531 . . . .

(Solved) : Fill Pattern Following Function Identify String Valid Phone Number Us Valid Phone Number U Q37428531 . . . .

 

Fill in the pattern in the following function to identify if astring is a valid phone number in US. A valid phone number in UScan be of any of the following formats, where x signifies adigit.

+1 (xxx) xxx-xxxx+1 (xxx)xxx-xxxx+1 xxx xxx xxxx+1 xxx-xxx-xxxx+1 xxx.xxx.xxxx+1 xxxxxxxxxx(xxx) xxx-xxxx(xxx)xxx-xxxxxxx xxx xxxxxxx-xxx-xxxxxxx.xxx.xxxxxxxxxxxxxx

import re
def isPhoneNumber(astring):
if re.match(“______________________”,astring):
return(“Valid phone number”)
else:
return(“Invalid phone number”)

Use regular expression pattern to summarize all thepossibilities to complete the code using python

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Draw Uml Diagram Describing Composition Relationship Elevator Building Dass Class Elevato Q29581412 . . . .(Solved) : Draw Uml Diagram Describing Composition Relationship Elevator Building Dass Class Elevato Q29581412 . . . .

<p dir="ltr"><img src="https://d2vlcm61l7u1fs.cloudfront.net/media%2F687%2F68764ae4-b956-45c0-ba13-ed3cd74c3c23%2Fimage" alt=". Draw a UML diagram describing the composition relationship between the Elevator and Building dass class Elevator f Ji class Building t publica Elevator elevators 1i Draw