Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
1
def
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
Callers
1
convert_wind_direction_to_degrees.py
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected