[RPG] If you get a spell through a racial ability, can you also take it as a spell from a class

dnd-5eracial-traitsspells

Say, for example, I'm a drow or a tiefling. I have the darkness spell once a day. However, I'm a warlock with Devil's Sight and I want as many chances to cast darkness as possible. Can I take darkness as a warlock spell as well, or can I only take it once as a racial spell?

Because I can't use slots to cast the racial spell (If you have the ability to cast a spell without a spell slot can you cast that spell using a spell slot?), I can't do that for extra uses. So could I, in that example, take darkness again or am I stuck with only the racial ability?

Best Answer

Yes, as indicated in the question you linked, spellcasting via different means are basically treated separately for rules purposes, except where otherwise noted. So a drow warlock 3 can cast darkness once per day as a racial ability, and separately, can cast darkness up to twice between short rests using their Pact Magic slots, if it's one of their spells known.