Back to problems

Lunar Phase State Lookup

Algorithm · Capital One · Medium

Requirements The lunar sequence contains eight unique states and repeats once every eight days. Use the states in cycle order: new moon, waxing crescent, first quarter, waxing gibbous, full moon, waning gibbous, third quarter, and waning crescent. Call the function as lunar_state(initial_state: str, season: str, day: int) -> str. The inputs are initial_state (the state on January 1), season, and day, which collectively identify a date within the year. Interpret day as the…

Checking your access…