Python Error "Length Is Not Defined" [Closed]

Python Error "Length Is Not Defined" [Closed]

Please help me fix this code! When I run it it says that "length is not defined"

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
2

1 Answer

The Python function is len not length

Maya Lin-Takahashi
Author

Maya Lin-Takahashi

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.