Answered step by step
Verified Expert Solution
Link Copied!

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?
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

Students also viewed these Databases questions