Python Python Basics Functions and Looping Raise an Exception

Vladimir Lapcevic
Vladimir Lapcevic
5,680 Points

What is the problem with my code? Thanks def suggest(product_idea): product_idea = input("Please suggest some idea")

suggestinator.py
def suggest(product_idea):
    product_idea = input("Please suggest some idea")
    if product_idea(len) < 3:
       raise ValueError("Can you please suggest longer name?")
    return product_idea + "inator"

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 35,790 Points
  • you don't need to prompt for the product_idea as it is passed in to the function as a parameter
  • len(product_idea) instead of product_idea(len)
  • one more indent space in this line: raise ValueError("Can you please suggest longer name?")