[Tutor] Reformatting phone number

Dotan Cohen dotancohen at gmail.com
Wed Aug 20 22:50:55 CEST 2008


I have gotten a bit farther, but I cannot get this to work as
described in the previous mail:

#!/usr/bin/env python
import sys
preNumber =  sys.argv[1]
if preNumber[0] == 0:
    number = '+972' + preNumber[1:]
else:
    number = '+' + preNumber

Where is my flaw?

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

ä-ö-ü-ß-Ä-Ö-Ü


More information about the Tutor mailing list