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
notlength使用len
notlength
使标题更具描述性。就目前情况而言,它没有告诉任何人有关这个问题的任何事情。
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