Helppp

import math
x = float(input(“Enter x: “))
y = float(input(“Enter y: “))
z = float(input(“Enter z: “))
print(”{} {:.2f}”.format(“a1 =”, x ** y + z))
print(”{} {:.2f}”.format(“a2 =”, math.cos(2 * math.pi) + math.log(x)))
print(”{} {:.2f}”.format(“a3 =”, abs(x) + abs(y)))
print("{} {:.2f}".format(“a4 =”, (x ** 2 + y ** 2 + z ** 2) ** (1/2)))
print("{} {:.2f}".format(“a5 =”, (math.sin(x) ** 2 + math.cos(x) ** 2))
print("{} {:.2f}".format(“a6 =”, (x + y) ** (1/5))) # <--------------- line 10
print("{} {:.2f}".format(“a7 =”, math.e ** (x * math.log(y))))

what is wrong with line 10?

also what is “pos5” in this error ->

line 10, in
print("{} {:.2f}".format(“a6 =”, (x + y) ** (1/5)))
Syntax Error: invalid syntax: , line 10, pos 5

Frequently, an error can be found in the line before the line that stops the code from executing. This would be the case here. Count your ('s in line 9. Do you have an equal number of )'s? :wink:

Also, in the future, please click on the </> icon prior to pasting code in a post. Then paste your code in the space indicated between the back tics. This will preserve the formatting, special characters and indentation which is very important in Python. Thanks.

Using the </> will make you code look like this:

def hello_world():
    return 'Hello World!'

print(hello_world())
1 Like