Light Mode
Dark Mode
How to isolate an item from a one single item set?

Can someone please tell me if there is a strait forward way to isolate its item from a set with one single item,
i.e. "a" from {"a"} ?

The only ones I can think of are:

 (1)  tuple({"a"})[0]
           which of course also can be - even more obfuscated - written as :
      (*({"a"}),)[0]
           and :
 (2)  list({"a"})[0]

but isn't there any less devious way (for e.g. use in a comprehension) ?

Thanks for any answer, Tinus.

  • python
  • syntax
Created: Oct. 30, 2017, 2:04 a.m.
Updated: Oct. 30, 2017, 9:51 a.m.
0
42
User avatar
Tinus_Trotyl