Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in Python, can you help me make this code? 1. The four compass points can be abbreviated by single-letter strings as N ,
in Python, can you help me make this code? 1. The four compass points can be abbreviated by single-letter strings as " N ", " E ", " S ", and "W". Write a function turn clockwise that takes one of these four compass points as its parameter, and returns the next compass point in the clockwise direction. Here are some tests that should pass: \[ \begin{array}{l} \text { test }(\text { turn_clockwise ("N") }==\text { E") } \\ \text { test (turn_clockwise ("W") }=\text { "N") } \end{array} \] You might ask "What if the argument to the function is some other valye?" For all other cases, the function should return the value None: \[ \begin{array}{l} \text { test (turn_clockwise }(42)=\text { None) } \\ \text { test(turn_clockwise ("rubbish") }=\text { None) } \end{array} \]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started