Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/305.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python错误“;“未定义长度”;_Python - Fatal编程技术网

Python错误“;“未定义长度”;

Python错误“;“未定义长度”;,python,Python,请帮我修复这个代码!当我运行它时,它说“长度未定义” Python函数是lennotlength使用lennotlength使标题更具描述性。就目前情况而言,它没有告诉任何人有关这个问题的任何事情。 word1 = "sesquipedalian" word2 = "sesquiannual" length_of_word1 = length(word1) length_of_word2 = length(word2) test_number = 429837427238472634872

请帮我修复这个代码!当我运行它时,它说“长度未定义”


Python函数是
len
not
length

使用
len
not
length
使标题更具描述性。就目前情况而言,它没有告诉任何人有关这个问题的任何事情。
word1 = "sesquipedalian"

word2 = "sesquiannual"
length_of_word1 = length(word1)

length_of_word2 = length(word2)

test_number = 4298374272384726348726348726348234

if length_of_word1>length_of_word2:
    test_number += length_of_word1%3
else:
    test_number -= length_of_word1%3

print test_number