PYTHON Study Guide - Local Variable, Global Variable

4 views4 pages
26 May 2023
Department
Course
Professor

Document Summary

#36 python tutorial for beginners | global variable in python | global variable vs local variable. Section overview: in this document, the speaker discusses the concept of scope in python functions and variables. They explain how to create local and global variables, how to access them within functions, and what happens when you try to change a global variable from within a function. Variables can be created inside or outside of functions. The concept of scope refers to where a variable can be accessed in your code. Local variables are defined inside a function and can only be accessed within that function. Global variables are defined outside of any function and can be accessed anywhere in your code. You cannot access local variables outside of the function they were defined in. Global variables can be accessed from anywhere in your code, including within functions.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers

Related Documents

Related Questions