Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1else if x > 5: print('mid') | AOutput: mid | |
| 2elif x > 5 print('mid') | BError: Use elif not 'else if' | |
| 3if x > 10: print('big') elif x > 5: print('mid') | COk: elif with == comparison | |
| 4elif score == 100: print('perfect') | DOutput: big | |
| 5x = 7 if x > 10: print('big') elif x > 5: print('mid') | EValid: elif checks next condition | |
| 6x = 15 if x > 10: print('big') elif x > 5: print('mid') | FError: Missing colon after elif |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
elif — Short for 'else if' - checks another condition if the previous was False.~~Chainingif x > 10:
print('Big')
elif x > 5:
print('Medium')if score >= 90:
print('A')
elif score >= 80:
print('B')if age >= 18:
print('Adult')
elif age >= 13:
print('Teen')if temp >= 35:
print('Hot')
elif temp >= 25:
print('Warm')if day == 'Monday':
print('Start')
elif day == 'Saturday':
print('Weekend')