How To Handle Attribute Error In Python