<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div style="-webkit-text-size-adjust: auto; ">Hi,</div><div style="-webkit-text-size-adjust: auto; "><br></div><div style="-webkit-text-size-adjust: auto; ">I'm using python 2.7. I'm editing the program with idle. I use windows 8.</div><div style="-webkit-text-size-adjust: auto; "><br></div><div style="-webkit-text-size-adjust: auto; "><span style="background-color: rgba(255, 255, 255, 0); ">I finally got the string to convert to integers, however I can't figure out how to print them in this phone number format</span><span style="background-color: rgba(255, 255, 255, 0); "> </span><a href="tel:555-5678" x-apple-data-detectors="true" x-apple-data-detectors-type="telephone" x-apple-data-detectors-result="0">555-5678</a><span style="background-color: rgba(255, 255, 255, 0); ">.</span></div><div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">The numbers are printing out this way.</span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">5</span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">5</span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">5</span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">5</span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">6</span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">Thank you very much. :)</span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);">Carmen </span></div><div><span style="-webkit-text-size-adjust: auto; background-color: rgba(255, 255, 255, 0);"><br>Sent from my iPhone</span></div><div style="-webkit-text-size-adjust: auto; "><br></div><br><span style="-webkit-text-size-adjust: auto;">Sent from my iPhone</span></div><div style="-webkit-text-size-adjust: auto; "><br>On Oct 31, 2013, at 6:33 AM, "bob gailer" <<a href="mailto:bgailer@gmail.com">bgailer@gmail.com</a>> wrote:<br><br></div><blockquote type="cite" style="-webkit-text-size-adjust: auto; "><div><span>On 10/30/2013 10:00 PM, Carmen Salcedo wrote:</span><br><span></span><br><span>> Hi Everyone,</span><br><span></span><br><span>hi</span><br><span></span><br><span>some guidelines for this list.</span><br><span>  post in plain text not html.</span><br><span>  tell us what version of Python you are using, what OS, what you use to edit and run the program.</span><br><span>  when replying:</span><br><span>    reply-all so a copy goes to the list</span><br><span>    put your responses following the relevant text</span><br><span>    delete irrelevant text</span><br><span>    if you get an exception (error) post the entire traceback. example:</span><br><span></span><br><span>File "N:\foo.py", line 2, in <module></span><br><span>    2/0</span><br><span>ZeroDivisionError: division by zero</span><br><span></span><br><span>> I hope you're having a great week.  I'm working on this program that converts strings to integers. Can someone please help me out? :)</span><br><span></span><br><span>What kind of help do you want?</span><br><span>It is a lot easier for us and more profitable for you when you</span><br><span>  are specific</span><br><span>  tell us what kind of help you need</span><br><span>  did you run the program?</span><br><span>  what did you get and what did you expect?</span><br><span></span><br><span>>Below is the program:</span><br><span></span><br><span>> def main():</span><br><span>>     selection = input("Enter you choice. Enter 1 " +</span><br><span>>                    "for Phone Translator or 2 for Backward String.")</span><br><span>>     while selection != 1 and selection !=2:</span><br><span>>         print "Invalid choice"</span><br><span>>         selection = input("Please enter you selection. Enter 1 " +</span><br><span>>                    "for Phone Translator or 2 for Backward String.")</span><br><span>>     if selection == 1:</span><br><span>>         phoneTranslator()</span><br><span>>     elif selection == 2:</span><br><span>>         backwardString()</span><br><span>> def phoneTranslator():</span><br><span>>     print "Phone Translator "</span><br><span>>     phoneNumber = raw_input ("Please enter the phone number: ")</span><br><span>>     phoneNumber = phoneNumber.upper()</span><br><span>>     for n in phoneNumber:</span><br><span>>         if str.isalpha(n):</span><br><span>>             if n == "A" or n == "B" or n == "C":</span><br><span>>                 n = "2"</span><br><span>>             elif n == "D" or n == "E" or n == "F":</span><br><span>>                 n = "3"</span><br><span>>             elif n == "G" or n == "H" or n == "I":</span><br><span>>                 n = "4"</span><br><span>>             elif n == "J" or n == "K" or n == "L":</span><br><span>>                 n = 5</span><br><span>>             elif n == "M" or n == "N" or n == "O":</span><br><span>>                 n = 6</span><br><span>>             elif n == "P" or n == "Q" or n == "R" or n == "S":</span><br><span>>                 n = 7</span><br><span>>             elif n == "T" or n == "U" or n == "V":</span><br><span>>                 n = "8"</span><br><span>>             else:</span><br><span>>                 n = "9"</span><br><span>>     print str.isalpha()</span><br><span>> main()</span><br><span>> Thanks!! :)</span><br><span>> Carmen</span><br><span></span><br><span>-- </span><br><span>Bob Gailer</span><br><span>919-636-4239</span><br><span>Chapel Hill NC</span><br><span></span><br></div></blockquote></body></html>