datacamp-logo

Understanding scope

What four values does this script print?

x = 50

def one():
  x = 10

def two():
  global x
  x = 30

def three():
  x = 100
  print(x)

for func in [one, two, three]:
  func()
  print(x)
Answer the question
50 XP
Possible Answers
  • press
  • press
  • press
  • press
  • press