MCPcopy Create free account
hub / github.com/geekcomputers/Python / degrees_to_compass

Function degrees_to_compass

convert_wind_direction_to_degrees.py:1–4  ·  view source on GitHub ↗
(degrees)

Source from the content-addressed store, hash-verified

1def degrees_to_compass(degrees):
2 directions = ["N", "NE", "E", "SE", "S", "SW", "W", "NW"]
3 index = round(degrees / 45) % 8
4 return directions[index]
5
6
7# Taking input from the user

Calls

no outgoing calls

Tested by

no test coverage detected