mardi 26 septembre 2017

Syntax error with if in function definition

I have this code:

def rho(switch,y,h):
    if switch=1:
        return 1.255
    if switch=2:
        return 1.255*np.exp(-y/h)

apparently the if statement has a syntax error, I can't figure out what it is.

Aucun commentaire:

Enregistrer un commentaire