Given an integer representing a 10-digit phone number, output the area code, prefix, and line number using the format (800) 555-1212.
Input: 8005551212
Output: (800) 555-1212
My code:
phone_number = input()
print('(', phone_number[0] + phone_number[1] + phone_number[2] + ') ' + phone_number[3] + phone_number[4] + phone_number[5] + '-' + phone_number[6] + phone_number[7] + phone_number[8] + phone_number[9])
However the output is giving me a space between the first parantheses and the number eight ( 800) 555-1212
How can I remove the space to get the correct formating?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here