diff --git a/arithmetic_arranger.py b/arithmetic_arranger.py index 6f59604..a6abfba 100644 --- a/arithmetic_arranger.py +++ b/arithmetic_arranger.py @@ -6,7 +6,7 @@ def arithmetic_arranger(problems, val=False): # list of all operations in str format operations = list(map(lambda x: x.split()[1], problems)) - if set(operations) != {'+', '-'} and len(set(operations)) != 2: + if set(operations) not in [{'+'}, {'-'}, {'+', '-'}] and len(set(operations)) > 2: arranged_problems = "Error: Operator must be '+' or '-'." return arranged_problems