asked 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

asked
User Dimnnv
by
8.9k 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.

answered
User Globalfish
by
9.0k points

No related questions found