The cobra is a male cobra.
When Timon leaves his guard post to prepare for his date with Tatiana, the cobra sees that the back gate is unprotected. While Timon is taking a shower, the cobra goes in the meerkat colony and kidnaps Tatiana, with everyone believing the princess is dead. When the Duke Meerkat returns, he banishes Timon for leaving his guard post.
After Timon meets Pumbaa, the two see that the cobra has still not eaten Tatiana. Timon tells Pumbaa that if he helps him rescue the princess, he will be accepted to his colony. The cobra then tries to eat Timon and Tatiana, but fails and accidentally falls into a lava pit.