Answer:
# User is prompted to enter phone number
phone_number = int(input("Enter your 10-digit phone number: "))
# this modulus operation will give the last 4 digit
# as the line number
line_number = phone_number % 10000
# this integer division will give a combination
# of area code and prefix
area_code_prefix = phone_number // 10000
# this integer division of the area_code_prefix
# will give the area_code
area_code = area_code_prefix // 1000
# this modulo operation of the area_code_prefix
# will give the prefix
prefix = area_code_prefix % 1000
# the phone number is printed in the specified format
print('(',area_code,')',' ',prefix,'-',line_number, sep='')
Explanation:
A sample image of program output is attached.