line shift? (baby steps 2)

Andrew Durdin adurdin at gmail.com
Mon Aug 23 08:34:02 EDT 2004


On 23 Aug 2004 05:12:30 -0700, Artemisio <calidusdk at hotmail.com> wrote:
> I have done a small currency calculator. It works and I'm very glad.
> But...I'd like to have a line shift if user types a wrong choice.

A simple "print" with no arguments should display the blank line you want:

while currency_str != "EUDK" and currency_str != "DKEU" and
currency_str != "USDK" and currency_str != "DKUS"\
and currency_str != "EUUS" and currency_str!= "USEU":
   print
   currency_choice= raw_input("Sorry. At the moment we only support
DKK, Euro and Dollars." + "\n" \
   "Type DKEU if you want convert from DKK to €," + "\n" \
       "EUDK if you want to convert from DKK to €," + "\n" \
        "DKUS if you want to convert from DKK to $," + "\n" \
        "USDK if you want to convert from $ to DKK," + "\n"
       "EUUS if you want to convert from € to $," + "\n"\
       "and USEU if you want to convert from $ to €: ")
   currency_str= str(currency_choice).upper()

Or you can add an extra "\n" at the beginning of your "Sorry" string.



More information about the Python-list mailing list