【发布时间】:2021-12-29 15:24:42
【问题描述】:
大家好,我需要弄清楚括号在以下表达式的代码中的位置,并且对括号的实际位置有点困惑。我总是弄错。
x = float(input('Enter a value for x: '))
# Insert parentheses in the following line to fix the expression.
y = x - 1 ** 0.5 + 1 / 5
print('y = ' + str(y))
【问题讨论】:
-
这似乎更像是一道数学题而不是编程题。您将如何对您发布的方程式进行运算顺序?你会遵循什么步骤?