What are local variables and global variables in Python?

Question

Can you help me with this question

Answer ( 1 )

    0
    2025-02-26T02:36:37+00:00
    • Global Variables: Variables declared outside a function or in a global space are called global variables. These variables can be accessed by any function in the program.
    • Local Variables: Any variable declared inside a function is known as a local variable. This variable is present in the local space and not in the global space.

Leave an answer