i don't see why not, i guess it just depends on the landlord or maybe the city laws. my landlord doesn't really notice my snakes when he comes but he usually sees an empty tank.

i would just ask the landlord of the apartment if he allows pets, usually they think dog/cat. maybe ask if they allow fish. cause thats basicly what a snake does most of the time, chill in it's tank/tub.