def readable_weekday(weekday): try: return day_name[weekday] except (TypeError,IndexError): return None