You are developing an application for travelers, which allows you to automatically formate the phone numbers of different countries. Your task is to write a function that correctly formates the number depending on its length so that the user can easily call abroad.
Input format
list of integers representing the numbers of the phone number (from 10 to 14 digits) SPAN>
Output format
a line representing an international phone number in accordance with the length of the number:
1 - Read the task and understand what needs to be done
2 - The example shows how the input data will be provided and what output is expected
3 - Write the code considering the input, output, and the task itself.
(see example below)
Difference Between the "Run" and "Test on All Cases" Buttons
1 - The “Run” button executes your code only on one set of input data, and you’ll see the result in the output window.
2 - The “Test on All Cases” button runs your code against all test cases. If all tests pass, a banner will appear. If even one test fails, it will be highlighted in red.
(see example below)
How to Change Input Data
To change the input data, click the “Run Test” button next to the input data you want to execute.
(see example below)
Working with Input/Output Windows
1 - Input Data is the window containing the values loaded into your program in place of input()
2 - Program Output is the window showing what your program prints. If it’s green, the output matches the expected result; if red, there are differences.
3 - Expected Output is the reference value used to verify the solution.
(see example below)
Guide to the "Run Test" Button
1 - Green means the program produced the correct output
2 - Red means the program’s output didn’t match the expected output for this data. The program output and the expected output must be identical, including spaces and punctuation!
(see example below)
Criteria for a Correct Solution — How to Know It’s Right
If you see this banner, congratulations — everything is correct.
1 - The first 10 tasks are quite easy and contain hints covering only the essential parts of the topic.
2 - The next 10 tasks are medium difficulty. Their hints differ from the easy ones and reveal new aspects of the topic.
3 - The hardest tasks have no hints. Often, they include additional topics, so sometimes it’s better to move on and return later. Read the hints carefully — they offer new ways to solve already familiar problems.
(see example below)
Availability of Theory (Video + Text)
1 - Each block contains a “Theory” section.
2 - It always includes a detailed video.
3 - There is also a detailed guide with all the necessary theory and code examples.
(see example below)
Social Media Links for Feedback
1 - Click the “Report an Error / Social Media” button
2 - Here you can describe the error you encountered.
3 - You’ll also find our social media links here — follow us and help us improve.
(see example below)
🎉 Congratulations! 🎉
You did an excellent job with the task! It was a challenging problem, but you found the correct solution. You are one step closer to mastering programming! Keep up the good work, because every stage you pass makes you even stronger.
AD
Advertisement
Running your code...
AI Helper
Hi! I am your programming assistant. Ask me anything about Python — I can explain functions, methods, and help you understand the current task!
🍪
Сначала примите условия
Чтобы войти на сайт, необходимо принять соглашение об использовании файлов cookie.
Мы используем их для авторизации и улучшения работы сайта.
🍪 Мы используем файлы cookie для авторизации, аналитики и улучшения работы сайта.
Продолжая пользоваться сайтом, вы соглашаетесь с нашей
политикой конфиденциальности.