| 1 | def check_list(List, CheckValue): |
| 2 | Result = True |
| 3 | # Loop |
| 4 | for Item in List: |
| 5 | # Check |
| 6 | if not Item == CheckValue: |
| 7 | Result = False |
| 8 | return Result |
| 9 | |
| 10 | # |
| 11 | # Example |
| 12 | # |
| 13 | |
| 14 | ListA = [1.0, 0.0, 0.0] |
| 15 | CheckA = 0.0 |
| 16 | |
| 17 | print(check_list(ListA, CheckA)) |
| 18 | # False |
| 19 | |
| 20 | ListB = [0.0, 0.0, 0.0] |
| 21 | CheckB = 0.0 |
| 22 | |
| 23 | print(check_list(ListB, CheckB)) |
| 24 | # True |
To add a comment, please login or register first.
Register or Login