blnOk=True if blnOk:a = 1 else: a = 2 print(a) input("Press Enter to exit...")
运行结果:
1 Press Enter to exit...