Check if object position and rotation are zero
You can try rounding the values to 2-3 decimal points when comparing with 0 to make sure you're not falling victim to floating point errors:

object = bpy.context.active_object

def nozeros( vec, decimal_points = 2 ):
    ''' Returns True if none of the elements in the provided vector vec
        equate to zero when rounded by the provided number of decimal_points
    '''

    return any( round( v, decimal_points ) for v in vec )

if nozeros(object.location) or nozeros(object.rotation_euler):
    print(object.location)
    print(object.rotation_euler)


If either the location or rotation of the active object is non-zero this will script print the values of both.