[Tutor] Expected indented block error

Arron Sutcliffe arronjsutcliffe at gmail.com
Sun Sep 22 00:44:58 CEST 2013


Hi i have been working on a currency converter for school and i have been
having a hard time with this syntax error "Expected indented block" and i
don't understand why it isn't working. i am fairly new to Python thus my
sloppy and unfinished code hope you can help :)
My code -
v_fallback = 1
while v_fallback == 1:
    print("Please enter your current currency")
    v_current = input()
    if v_current == ("USD" or "usd" or "US Dollars" or "us dollars"):
        print("Please enter the name of the currency you wish to convert
to")
        print("Your options are GBP, EUR, INR, AUD, CAD, AED or BACK to
return to the Main Menu")
        v_final = input()
        if v_final ==("GBP" or "gpb"):
        if v_final == ("EUR" or "eur"):
        if v_final == ("INR" or "inr"):
        if v_final == ("AUD" or "aud"):
        if v_final == ("CAD" or "cad"):
        if v_final == ("AED" or "aed"):
        if v_final == ("BACK" or "back"):
        else:
            print ("ERROR - Please enter a valid currency, if incorrect
currency is entered again program will close")
            print("Your options are GBP, EUR, INR, AUD, CAD, AED or BACK to
return to the main menu")
            v_final = input()
            if v_final == ("GBP" or "gbp"):
            if v_final == ("EUR" or "eur"):
            if v_final == ("INR" or "inr"):
            if v_final == ("AUD" or "aud"):
            if v_final ==("CAD" or "cad"):
            if v_final == ("AED" or "aed"):
            if v_final == ("BACK" or "back"):
        else print ("ERROR - Program will close"):
            v_fallback = 0
    #if v_current == ("GBP" or "gbp" or "pounds" or "Pounds" or "pounds
sterling"):
        #v_exrate =
    #v_fallback = 0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130921/bd07b60a/attachment.html>


More information about the Tutor mailing list