What are local variables and global variables in Python?

Home Forums Software Testing Discussions What are local variables and global variables in Python?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25821
    jhon
    Participant
    @richards12

    Hi, i need to know what are local variables and global variables in python

    #25832
    Nick
    Participant
    @nickdevelux

    In Python, it’s means that local variables can be accessed only inside the function in which they are declared, whereas global variables can be accessed throughout the program body by all functions. When you call a function, the variables declared inside it are brought into scope.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.