Python Python Basics Functions and Looping Raise an Exception

Omar Graham
Omar Graham
1,350 Points

how do you measure the length and the characters within a string?

suggestinator.py
def suggest(product_idea):
    if product_idea < product_idea:
        raise ValueError("The length has to be more than 3 characters")
    return product_idea + "inator"

1 Answer

Matik Zed
Matik Zed
11,491 Points

Hey Omar you can use the built-in len function :)