I did say I didn't know python... replaced && with and for compound conditions, d'oh\!