Respuesta :
The python program will request for a ten digit number from the user and formulate a real phone number from it.
How to write a python program to form a real phone number?
The program is written in python.
Therefore,
x = input("please write a ten digit number: ")
if len(x) == 10:
a = f"({x[0:3]})"
b = x[3:6]
c = x[7:]
print(a + " " + b + "-" + c)
Code explanation:
- The variable x is used to store the user's input.
- If the length of x is equals to 10, then we get the first three terms in bracket, the second three terms and the last 4 terms.
- Finally, we use delimiters to join the variables as required and print it out.
learn more on python here: brainly.com/question/13462052
#SPJ1


