title: Any type of scope resolution operator in Python?
body: <p>Is there any way to make the python interpreter choose the global variable specifically when there is also a local variable with the same name? (Like C++ has :: operator)</p>
  
  <pre><code>x=50
  
  def fun():
      x=20
      print("The value of local x is",x)
  
      global x
      #How can I display the value of global x here?
      print("The value of global x is",x)
  
  print("The value of global x is",x)
  fun()
  </code></pre>
  
  <p>The second print statement inside the function block should display the value of global x. </p>
  
  <pre><code>File "/home/karthik/PycharmProjects/helloworld/scope.py", line 7
  
  global x
  ^
  
  SyntaxError: name 'x' is used prior to global declaration
  
  Process finished with exit code 1
  </code></pre>