What is wrong with the code?

Report a typo

Below you can find a program code that is supposed to take a phone number as an input and extract the country code from it. At first glance, the code is perfect, but it raises an error. Can you spot the issue?

Sample Input 1:

+12345678900

Sample Output 1:

Country code: 1
Write a program in Python 3
phone = input()
phone = sign, code, *rest
print('Country code:', code)
___

Create a free account to access the full topic