每次把你上面的表达式输入进去
s1 = "我喜欢你"
s2 = "Python"
while True:
string = input("请输入你要执行的表达式(例如:s1 + s2)'q' 退出:")
if string == 'q':
break
try:
res = eval(string)
print("\033[1;36m {}\033[0m".format(res))
except Exception as e:
print("\033[1;31m {}\033[0m".format(e))