简单教程
提交运行
代码编辑器:
#!/usr/bin/python # -*- coding: UTF-8 -*- a = 20 b = 10 c = 15 d = 5 e = 0 e = (a + b) * c / d # ( 30 * 15 ) / 5 print("(a + b) * c / d 运算结果为:", e) e = ((a + b) * c) / d # (30 * 15 ) / 5 print("((a + b) * c) / d 运算结果为:", e) e = (a + b) * (c / d) # (30) * (15/5) print("(a + b) * (c / d) 运算结果为:", e) e = a + (b * c) / d # 20 + (150/5) print("a + (b * c) / d 运算结果为:", e)
运行结果: