I want to check all the values in a and let the code run once below all true, but if I make an ellse statement, the for statement keeps running while it repeats, and when I take it out, it just runs regardless of the if statement.
Is there a way to check the value in a and proceed with the code below only when they are all the same?
ps. Even if it is not a for statement, it is also good to check the value in the list and execute the code below when it is the same.python
Python has all, any.
© 2022 pinfo. All rights reserved.