xString = input("Enter a number: ")
x = int(xString)
yString = input("Enter a second number: ")
y = int(yString)
print('The sum of ', x, ' and ', y, ' is ', x+y, '.', sep='')
on executing above code, interpretor throwing syntax error saying syntax error as below.
print(?The sum of ?, x, ? and ?, y, ? is ?, sum, ?.?, sep=??)
SyntaxError: invalid syntax
解决方案
The single quote used in the print statement is ' with ascii value 39.
>>> ord("'")
39
The one ’ used in the print statement in the question is not a quote ' but RIGHT SINGLE QUOTATION MARK' (U+2019)
>>> u"’"
u'\u2019'
Since, you are using python 2, to use sep in the print statement you need to import the functionality from the future.
from __future__ import print_function
print('The sum of ', x, ' and ', y, ' is ', x+y, '.', sep='')