-3

If I have an object:

w = {'A'}

how do I test if this is a set or not?

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
Dirk
  • 3,073
  • 4
  • 31
  • 36

1 Answers1

3
if isinstance(w, set):

Add this if statement to check, replace w with the variable you want to check.

no_name
  • 742
  • 3
  • 10