Question: In python write a program for the following: The four compass points can be abbreviated by single - letter strings as N , E ,

In python write a program for the following: The four compass points can be abbreviated by single-letter strings as N,E,S, and W. Write a function `turn_clockwise (compass_point:str)` that takes one of these four compass points as its parameter, and returns the next compass point in the clockwise direction. If `compass_point` has another value that's distinct from the four compass points listed earlier, return the value `None`.
Input:
String representing a cardinal direction
Output:
String representing a cardinal direction that is a 90 degree clockwise turn from the input cardinal direction.
Example Cases:
```
turn_clockwise("N")=>"E"
turn_clockwise("W")=>"N"
turn_clockwise("S")=>"W"
turn_clockwise("E")=>"S"
turn_clockwise(42)=> None
turn_clockwise("rubbish")=> None

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!