Checking Membership Level

Is there a code snippet that I can use to check what level of membership someone is?