title: Name 'x' is parameter and global [Python]
body: <p>I was wondering why this won't work? I'm fairly new to programming and I'm learning Python. </p>
  
  <pre><code>def convert(x,y):
      while True:
          try:
              global x
              x = int(input("Number: "))
          except ValueError:
              print("Make sure it is a number.")
      while True:
          try:
              global y
              y = int(input("Number: "))
          except ValueError:
              print("Make sure it is a number.")
  
  
  convert(x,y)
  </code></pre>
  
  <p>Please tell me how to make this work.</p>
  
  <p>Also, the error I get when I run this is name 'x' is parameter and global.</p>
  
  <p>Ok, I fixed it. This is the correct code.</p>
  
  <pre><code>def convert():
      while True:
          try:
              global number
              number = int(input("Number: "))
              break
          except ValueError:
              print("Make sure it is a number.")
      while True:
          try:
              global number2
              number2 = int(input("Number: "))
              break
          except ValueError:
              print("Make sure it is a number.")
  
  
  convert()
  </code></pre>