EpythonProject1venvScriptspythonexe EpythonProject1mainpy Traceback most recent call last File EpythonProject1mainpy line 6 in module tatol=sum12 ^^^^^^^^ File EpythonProject1mainpy line
The error message suggests that there is a NameError in your code. Specifically, the variable total is not defined.
It seems like you have a typo in your code. Instead of tatol=sum(1,2), it should be total=sum(1,2). The correct code should be:
def sum(a, b):
total = a + b
print(total)
total = sum(1, 2)
By fixing the typo, the code should execute without any errors.
原文地址: https://www.cveoy.top/t/topic/ioC2 著作权归作者所有。请勿转载和采集!