valid_chars=('0','1','2','3','4','5','6','7','8','9',' ') alphabet=('a','b','c','d','e','f','g','h','i','j','k','l','n','o','p','q','r','s','t','u','v','w','x','y','z') phone_number=str(input('type in your phone number')) print(phone_number) if len(phone_number)<11 or len(phone_number)>13: print('Error,you need to enter a phone number that is between 11-13 characters long') if valid_chars=alphabet print(Error, MUST contian only numbers)
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question