求用Python IDLE编程

img


需要用Python3.8 IDLE进行编程,最基础的,没有难度,想请各位帮忙,类似这种

img

每次把你上面的表达式输入进去

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))