Skip to content
C

Phone Number Validator

Easypython

Write a function isvalidphone(number) that returns True if the input is exactly 10 digits, False otherwise.

Approach: anchor the pattern to both the start and end of the string with ^ and $ so partial matches don't count.

Input: One line: a phone number as text.

Output: One line: True or False.

Input (stdin)

Output

Run your code to see output here...