Question: omplete the table below that lays out syntax and use rules for the if , elif, and else keywords. Rule Correct Example Incorrect Example A

omplete the table below that lays out syntax and use rules for the if, elif, and else keywords.
Rule Correct Example Incorrect Example
A set of branches must be-
gin with the if keyword
cond x ==5:
Branches must use an ex-
pression that evaluates to
the Boolean type
if value >2.4:
Branches must end their
line with a colon after the
Boolean expression
if boolean_var
if x ==5:
x +=2
y ='b'
#print not in branch
print('done')
if x ==5:
#nothing in the branch
print('done')
0 or more branches can
start with elif, but only af-
ter an initial if branch
if val >3:
print('>3')
elif val >2:
print('>2')
elif val >1:
print('>1')
0 or 1 else branches can be
used at the end of a series
of branches
if y != 'test' :
print('not test' )
else:
print('test')
else:
print("won't work" )

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!