Small refactor and isort+black formatting
This commit is contained in:
@@ -9,13 +9,10 @@ def weekdays_bitmask(data: OrderedDict[str, bool]) -> str:
|
||||
|
||||
### Returns:
|
||||
* str: _description_
|
||||
"""
|
||||
output = ""
|
||||
"""
|
||||
if len(data) != 7:
|
||||
raise ValueError("OrderedDict must be formatted as follows: OrderedDict(Monday=bool, Tuesday=bool, Wednesday=bool, Thursday=bool, Friday=bool, Saturday=bool, Sunday=bool)")
|
||||
for day in data:
|
||||
if data[day]:
|
||||
output += "1"
|
||||
else:
|
||||
output += "0"
|
||||
return output
|
||||
raise ValueError(
|
||||
"OrderedDict must be formatted as follows: OrderedDict(Monday=bool, Tuesday=bool, Wednesday=bool, Thursday=bool, Friday=bool, Saturday=bool, Sunday=bool)"
|
||||
)
|
||||
|
||||
return "".join("1" if data[day] else "0" for day in data)
|
||||
|
Reference in New Issue
Block a user