title: Cannot Connect to SQL Instance IF Server Name is from input()
body: <p>I have been playing around with pyodbc and for some reason when trying to connect if I get the Server property from a input() it cannot find the server, but if I take the same server name and declare it as a variable before hand it works fine with the exact same code. Does anyone know what is going on here? </p>
  
  <p><strong>Code with input()</strong></p>
  
  <pre><code>import pyodbc 
  
  driver = '{ODBC Driver 17 for SQL Server}'
  instance = input("Please Enter your SQL Instance: ")
  connectionstring = f'Driver={driver}; Server={instance}; Trusted_Connection=yes'
  conn = pyodbc.connect(connectionstring)
  cursor = conn.cursor()
  cursor.execute('SELECT name FROM sys.databases')
  
  for row in cursor:
      print(row)
  </code></pre>
  
  <p><strong>Output</strong>
  <a href="https://i.stack.imgur.com/AZP4h.png" rel="nofollow noreferrer">Code output server name from Input()</a></p>
  
  <p><strong>Code with Variable</strong></p>
  
  <pre><code>import pyodbc 
  
  driver = '{ODBC Driver 17 for SQL Server}'
  instance = 'DESKTOP-J7PBL8S\\NORTHWIND'
  connectionstring = f'Driver={driver}; Server={instance}; Trusted_Connection=yes'
  conn = pyodbc.connect(connectionstring)
  cursor = conn.cursor()
  cursor.execute('SELECT name FROM sys.databases')
  
  for row in cursor:
      print(row)
  </code></pre>
  
  <p><strong>Output</strong>
  <a href="https://i.stack.imgur.com/5c1tD.png" rel="nofollow noreferrer">Code output server name from variable</a></p>
  
  <p>I have tried using str() on the input with no luck. Not really sure why it doesn't like when I get the server name from an input because it returns a string and the connection string is exactly the same as the code that works.</p>
  
  <p>I am kind of curious why this is the case not really looking to use input() on any real project  </p>