Tip:
Highlight text to annotate it
X
All right, let's go over the possible answers together.
We say that a statement has to be an identifier followed by an equals sign
followed by an expression.
Lata, l-a-t-a, is definitely an identifier using our previous rules.
That's a collection of upper and lower case letters that may include an underscore,
but the underscore can't come first.
This is an identifier, and expression can go directly to number,
and 1 is a number, so this is totally valid.
Here we have Mangeshkar = 19 + 29.
Well, Mangeshkar is longer, but it's still an identifier.
It's a collection of letters, and it may have underscores, but it doesn't.
And then we have the equals sign. That matches.
And now we're going to use this rule here, expression goes to expression + expression
to get this + sign, and then expression will go to number for 19,
and expression will go to number for 29.
I like this.
Here we have Lata = Lata + 1.
This one is tricky because it's totally valid in Python,
but it's not valid in this grammar.
I haven't said that expression can go to identifier,
so Lata is an identifier.
The equals sign is an equals sign.
But over here I need something like 1 + 1.
I don't yet have a rule that would allow me to have Lata + 1.
If I had this mysterious fifth rule, then this would be in the language of the grammar.
But I don't yet, so it isn't.
And then over here, Mangeshkar = 25,000 - 1,
that's an identifier =,
and now we're going to use this rule here, expression - expression.
This totally works out.
Lata Mangeshkar is a famous Indian playback singer.
She's recorded over 25,000 songs,
a world record for quite some time, and she's also received India's highest civilian honor.