50.0k views
1 vote
Variable index has a value of 4, and variable accessValid has a value of False. What value does variable, accessPoints, have after the if is executed?

accessPoints = 0
if ((index >=2) or accessValid):
accessPoints += 10
else:
accessPoints = 1

User Dimnnv
by
4.7k points

1 Answer

4 votes

Answer:

10

Step-by-step explanation:

If index is greater than or equal to 2, accessPoints will increase by 10 even if accessValid is false because the if statement states that if index is greater than or equal to 2 OR accessValid is true. The if statement gets executed if either expression is true, and index is greater than 2 because index has a value of 4.

User Globalfish
by
4.9k points