-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Hey,
Just recently I got stuck on the Wordy exercise due to what seems like some quite arbitrary error requirements.
Largely the syntax of a correctly formed sentence seems to match the following regex:
^What is( (\d+ [+-*/]))* \d+?$
How come a value like "Who is the President of the United States?" is supposed to raise ValueError("unknown operation") when the syntax of the whole sentence mismatches a correctly formed question. It seems like a ValueError("syntax error") would be more fitting here.
Additionally we could argue the same for the "What is 52 cubed?". You could pose this question in a way that aligns with the syntax more using a statement like "What is 52 to power of 2". This way we could keep the syntax like and avoid having to use so many exceptions.