Why are Options 1 and 4 correct and 2 and 3 not?
Variables grade1 and grade2 represent grades in two courses. Variable num_passed currently refers to 0. Select the code fragment(s) that make num_passed refer to the number of courses passed (with a 50 or higher).
Option 1
if grade1 >= 50:
num_passed = num_passed + 1
if grade2 >= 50:
num_passed = num_passed + 1
Option 2
if grade1 >= 50:
num_passed = num_passed + 1
elif grade2 >= 50:
num_passed = num_passed + 1
Option 3
if grade1 >= 50 and grade2 >= 50:
num_passed = 2
if grade1 >= 50:
num_passed = 1
if grade2 >= 50:
num_passed = 1
Option 4
if grade1 >= 50 and grade2 >= 50:
num_passed = 2
elif grade1 >= 50:
num_passed = 1
elif grade2 >= 50:
num_passed = 1