#How do I use a variable created inside an if-statement/function outside the if-statement/function?
4 messages · Page 1 of 1 (latest)
you don't
you can create a global variable or a variable in the higher scope (outside your if)
Can you give an example of what you mean?
Variables defined inside control blocks like "if" or "while" are not considered a separate block of code, and they can be used within the entire function, class, or module where they were defined