Python Developer Question:
Download Job Interview Questions and Answers PDF
Please explain what are the rules for local and global variables in Python?
Answer:
Local variables: If a variable is assigned a new value anywhere within the function’s body, it’s assumed to be local.
Global variables: Those variables that are only referenced inside a function are implicitly global.
Global variables: Those variables that are only referenced inside a function are implicitly global.
Download Python Developer Interview Questions And Answers
PDF
Previous Question | Next Question |
Do you know how memory is managed in Python? | Explain me database connection in Python Flask? |