Question: Python: IF THEN | IF THEN ELSE | ID COMP_OP INT ID ASSIGN INT t_COMP_OP= r'==|!=|>=|

Python:

IF THEN | IF THEN ELSE |

ID COMP_OP INT

ID ASSIGN INT

t_COMP_OP= r'==|!=|>=|<=|<|>'

t_ID= r'[a-z]+'

t_ASSIGN= r'='

Valid syntax?

(1) grade > 70

(2) GRADE = 100

(3) grade = 100

(4) if grade >= 70 then grade = 100

(5) if grade >= 70 then if grade < 80 then grade = 75 else grade = 100

Choices for 5 questions above are

(A) yes

(B) No, it contains a lexical error

(C) No, it contains syntax error

Please explain your pick. Thanks.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!