Answers for "python what scope are variables"

3

how does scope work in python

a = 5
b = 3

def f1():
  a = 2
  print(a)
  print(b)
  
print(a)   # Will print 5
f1()       # Will print 2 and 3
Posted by: Guest on July-11-2020

Code answers related to "python what scope are variables"

Python Answers by Framework

Browse Popular Code Answers by Language