Find left side of definitions?

How do I find the left side of the sets as the following example?

o = {3, 2};
g = {9};
z = {5, 7};
f = {8, 11};

I’d like the result to be:

6683ima1.png

I would like a code to do this even if I change or add more definitions to the sets list freely, for example adding two more sets or renaming some.

My attempt to accomplish this (although believe that must have a much easier way):

ClearAll["Global`*"]

o = {3, 2};
g = {9};
z = {5, 7};
f = {8, 11};

FromLetterNumber[
 Select[Flatten[
   Table[If[
     Length[Flatten[
        Take[Position[
          Table[If[
            FromDigits[
              Flatten[
               Take[Alphabet[] // ToExpression, {ii}]]] \[Element] 
             Reals, 1], {ii, 1, 26}], 1], {ii}]]] < 2, 
     Take[Position[
       Table[If[
         FromDigits[
           Flatten[
            Take[Alphabet[] // ToExpression, {ii}]]] \[Element] Reals,
          1], {ii, 1, 26}], 1], {ii}]], {ii, 1, 26}]], NumberQ]]

9796ima2.png

My achievement was partial, because the answer is not organized correctly in a way that I want (instead, it was in alphabetic sort). Is there any way to do that with a smarter code? Would someone please know how to help me?

Thanks.

This is shorter, but still not ordered in your preferred way.

o = {3, 2};
g = {9};
z = {5, 7};
f = {8, 11};

#[[Flatten@Position[Symbol /@ #, _List]]] &@Names[$Context <> "*"]

(* {“f”, “g”, “o”, “z”} * )

Thank you very much Tim, your code is very beautiful and powerful! I’ve tested your code for several special characters and different sets and the result was very very good. I’m very impressed! (while my code just works with the simple alphabet and numerical sets..)

ClearAll["Global`*"]

a? = {1, "ç", 9};
o\[Infinity]o = {3, 2/3};
\[BlackBishop]z = {9, "©"};
?? = {"5", 7};
\[FivePointedStar]\:f090 = {};
\[Checkmark]f? = {"\[FivePointedStar]", 0};
\[Wolf]\[WolframLanguageLogoCircle] = {22.4};
?4 = {0, 0, Sqrt[15]};
h\[WolframAlphaPrompt]7 = {17, "ij"};

#[[Flatten@Position[Symbol /@ #, _List]]] &@Names[$Context <> "*"]

The character codes of the special characters I used in the test:

imagg2.png

(*{{169},{36557,65532},{43458,52},{97,65100},{104,62290,55},{111,8734,
111},{9821,122},{10003,102,42522},{9733,61584},{63264,61727}}*)

Thank you.

You are welcome Claudio. I am glad that it worked out for you and is more general than I imagined.