To determine if a variable exists?

Asked 2 years ago, Updated 2 years ago, 100 views

What should I do if I want to know what variables exist or not? Is there any other way than to write an exception like my code?

try:
   myVar
except NameError:
   # # Do something.

python exception variable

2022-09-22 22:33

1 Answers

You can use it with .


2022-09-22 22:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.