jeudi 18 février 2016

Comparing IF statements to a final script with outcome

def coordinates():

    coordinate_X = int
    coordinate_Y = int

    userx = int(input("Please enter a number for coordinate x"))
    usery = int(input("coordinate y"))
    accepted = (True) or (False)
    accepted2 = (True) or (False)

    accepted = False
    if userx range(0, 600):
        return print("error")
    else accepted = True:
        return print("ook")

    accepted2 = False
    if usery range(0, 400):
    return print("error") 
        return print("error")
    else accepted2 = True:
        return print("ok")

    if accepted + accepted2 = True:
        return print("coordinates are ok")
    else:
        return print("coordinates are not ok")


coordinates()

What I want to happen is if the top two IF statements are true (Userx and Y) then the bottom IF statement will return a different answer.

Aucun commentaire:

Enregistrer un commentaire