Python 在绝对值计算器中接收到意外语法错误

Python 在绝对值计算器中接收到意外语法错误,python,cmath,Python,Cmath,代码: avsol上有语法错误,是的,我导入了cmath print ("Welcome to my Calculator") print ("Calculators: Absolute Value [av]") load = int(input("Enter the calculator code here: ")) if load == av: import cmath import math avnum2 = int(input("Enter the number to h

代码:

avsol上有语法错误,是的,我导入了cmath

print ("Welcome to my Calculator")
print ("Calculators: Absolute Value [av]")

load = int(input("Enter the calculator code here: "))

if load == av:

 import cmath

 import math

 avnum2 = int(input("Enter the number to have it's absolute value found: ")

 **avsol** = cmath.fabs (avnum2)

 print ("The solution (absolute value) is: ", avsol)

您错过了这一行的结束语。

谢谢您的反馈!
avnum2 = int(input("Enter the number to have it's absolute value found: ")
                                                                          ^